From: Pip Cet <pipcet@gmail.com>
To: andrewjmoreton@gmail.com
Cc: 32477@debbugs.gnu.org
Subject: bug#32477: 27.0.50; `=` burps on bignums when compiled
Date: Mon, 20 Aug 2018 20:44:18 +0000 [thread overview]
Message-ID: <CAOqdjBd_9DY3JfF=EcPurM7CeD0thtauLTR2=AXuvJXTKFxrnQ@mail.gmail.com> (raw)
In-Reply-To: <86o9dxg6nq.fsf@gmail.com>
On Mon, Aug 20, 2018 at 1:38 AM Andy Moreton <andrewjmoreton@gmail.com> wrote:
> On Sun 19 Aug 2018, Stefan Monnier wrote:
>
> > Package: Emacs
> > Version: 27.0.50
> >
> > If you try
> >
> > M-: (funcall (lambda (x) (= x x)) (expt 2 64)) RET
> >
> > you'll unsurprisingly get t as result. Yay! But if you try
> >
> > M-: (funcall (byte-compile '(lambda (x) (= x x))) (expt 2 64)) RET
> >
> > you should be prompted with an error stating that this largish number is
> > not a number-or-marker. This error occurs for example when loading
> > elpa/packages/xelb/xcb-types.elc.
>
> I can reproduce this on a 64bit build on Windows. The following lightly
> tested patch appears to work:
>
> diff --git a/src/bytecode.c b/src/bytecode.c
> index b27fa7c5c6..155f714a56 100644
> --- a/src/bytecode.c
> +++ b/src/bytecode.c
> @@ -990,8 +990,8 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
> TOP = arithcompare (v1, v2, ARITH_EQUAL);
> else
> {
> - CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER (v1);
> - CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER (v2);
> + CHECK_INTEGER_COERCE_MARKER (v1);
> + CHECK_INTEGER_COERCE_MARKER (v2);
> TOP = EQ (v1, v2) ? Qt : Qnil;
> }
> NEXT;
>
(funcall (byte-compile '(lambda (x y) (= (expt 2 x) (expt 2 y)))) 64 64)
returns nil with this patch: we want `eql', not `eq'.
(I think we should simply call arithcompare in all cases, but we can
add a FIXNUMP (v1) && FIXNUMP (v2) condition, too).
prev parent reply other threads:[~2018-08-20 20:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-19 23:14 bug#32477: 27.0.50; `=` burps on bignums when compiled Stefan Monnier
2018-08-20 1:37 ` Andy Moreton
2018-08-20 20:44 ` Pip Cet [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOqdjBd_9DY3JfF=EcPurM7CeD0thtauLTR2=AXuvJXTKFxrnQ@mail.gmail.com' \
--to=pipcet@gmail.com \
--cc=32477@debbugs.gnu.org \
--cc=andrewjmoreton@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.