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

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

bug#46812: 28.0.50; [native-comp] (lambda (x) (if (= x 0.0) (floatp x) (


From: Andrea Corallo
Subject: bug#46812: 28.0.50; [native-comp] (lambda (x) (if (= x 0.0) (floatp x) (error ""))) miscompiled
Date: Sun, 28 Feb 2021 23:03:37 +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 (native-compile `(lambda (x) (if (= x 0.0) (floatp x) (error "")))) 
>> 0)
>
> Nice reproducer for a nice bug.
>
> This week-end I'm mostly off, will come back on this very quickly.
>

Here what was going on:

`=' was treated homogeneously with other equality operators and in the
'then' branch of:

(if (= x 0.0)
    then
  else)

we were assuming x being 0.0.

Indeed that's not correct as `=' has a more complex semantic allowing
mixed integer float comparisons; ex (= 0 0.0) is satisfied.

5bc08559e8 allow now fwprop to propagate `=' semantic hopefully
correctly, the patch adds also a bunch of tests to check for this.

Closing as the reproducer is passing here.

Thanks for reporting

  Andrea





reply via email to

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