emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excessive use of `eassert`


From: Alan Mackenzie
Subject: Re: Excessive use of `eassert`
Date: Mon, 22 Jan 2024 14:37:04 +0000

Hello, Paul.

On Sun, Jan 21, 2024 at 21:19:30 -0800, Paul Eggert wrote:
> On 2024-01-21 02:59, Alan Mackenzie wrote:

> > I don't think the first patch is correct.  With it applied, the code
> > no longer signals the error of a symbol with position being processed
> > when symbols_with_pos_enabled is false.  That's in the debug build, of
> > course.

> Oh, I think I see what you mean: although the patch is correct when 
> callers use XSYMBOL correctly, ....

No, the patch is wrong.  If things only had to work when callers call
things correctly, we could scrap an awful lot more error checking code
and speed Emacs up enormously.

> .... if a caller has a bug that causes it to call XSYMBOL on a
> symbol-with-position when symbols_with_pos_enabled is false, then
> because of the patch this bug in the caller won't be diagnosed by an
> eassert failure within XSYMBOL in a debug build.

Yes.  This is a bug.

> I installed the attached to try to fix that. This patch doesn't affect 
> regular builds and so should preserve the minor performance advantage on 
> regular builds.

Your latest patch doesn't fix it.  In a regular build, symbols with
position are handled differently depending on the value of
symbols_with_pos_enabled.  Or at least they were and they must be.  Thus
in XBARE_SYMBOL, one MUST test s_w_p_e, regardless of whether the build
is a regular one or a debugging one.

Please fix this.

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]