Subject: Re: bug#74771: Native compilation bug with struct predicates when lexical binding enabled (HEAD)
From: Andrea Corallo <[email-masked]>
To: Eric Marsden <[email-masked]>
Cc: [email-masked]
Date: Mon, 24 Mar 2025 16:26:57 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Eric Marsden <[email-masked]> writes:

> On 23/03/2025 17:37, Andrea Corallo wrote:
>> Eric Marsden <[email-masked]> writes:
>>
>>> With the attached source file, Emacs miscompiles the struct predicate such
>>> that a repeated call to the predicate on a non-struct object returns t.
>>> This occurs with current HEAD on Linux/AMD64, but not on the Emacs 30.0.92
>>> pretest. It does not occur when the lexical binding cookie is not present.
>>>
>>> % /opt/emacs/bin/emacs -Q --batch --eval "(load (native-compile \"/tmp/bug.el\"))" -f run
>>> Loading /home/emarsden/.emacs.d/eln-cache/31.0.50-c021c983/bug-59c4b27c-c70072f9.eln (native compiled elisp)...
>>> Running in GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2)
>>>   of 2024-12-09
>>> is? nil
>>> is? t   ;; expecting nil
>>> bar: 111
>> Hi Eric,
>>
>> could you try with d565a6747a2, seems to work for me.  I'll want to do
>> more work in this area anyway this fixes the issue now.
>
> Hello,
>
> I tested with current HEAD (0cfe700e336) which resolves the problem, also on my full application. Thanks!
>
> Eric

Cool, closing then.

Thanks for the good report and sorry for the wait.

  Andrea