bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#46843: 28.0.50; [native-comp] (lambda (x) (if (equal x b) (eq x b) (


From: Andrea Corallo
Subject: bug#46843: 28.0.50; [native-comp] (lambda (x) (if (equal x b) (eq x b) (error ""))) miscompiled
Date: Mon, 01 Mar 2021 17:26:29 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> writes:

> Pip Cet <pipcet@gmail.com> writes:
>
>> In *scratch*, evaluate
>>
>> (funcall
>>  (let* ((lexical-binding t)
>>         (a (list 'a))
>>         (b (cons a a)))
>>    (native-compile
>>     `(lambda (x) (if (equal x ',b) (eq x ',b) (error "")))))
>>  '((a) a))
>>
>> Expected result:
>>
>> nil
>>
>> Actual result:
>>
>> t
>
> Thanks for reporting this, will come-up with a fix.

Right 3d014e1bf4 is fixing the wrong assumtion that `equal' `eql' can be
treated as `eq' in propagation as every immediate in the compilation
unit is hash consed.  Indeed this assumtion is wrong for more than one
reason.

Now under `equal' `eql' we propagate only fixnums and symbols values,
all the other kind of values are promoted to their respective types and
propagated as such.

The patch adds some tests for that too.

As the two reproducer are working here I'm closing this.

Thanks for reporting.

  Andrea





reply via email to

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