* bug#32477: 27.0.50; `=` burps on bignums when compiled
@ 2018-08-19 23:14 Stefan Monnier
2018-08-20 1:37 ` Andy Moreton
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2018-08-19 23:14 UTC (permalink / raw)
To: 32477; +Cc: Chris Feng
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.
Stefan
In GNU Emacs 27.0.50 (build 1, x86_64-unknown-linux-gnu, GTK+ Version 3.22.30)
of 2018-08-19 built on alfajor
Repository revision: 14acf8634c0b359fbbd3234dff65b40d9a12f26d
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Debian GNU/Linux buster/sid
Recent messages:
Wrote /home/monnier/src/emacs/work/src/lread.c
Finding changes in /home/monnier/src/emacs/work/src/alloc.c...done
Hunk undone
Saving file /home/monnier/src/emacs/work/src/alloc.c...
Wrote /home/monnier/src/emacs/work/src/alloc.c
Command: set annotate 1
t [2 times]
Entering debugger...
Continuing.
funcall: Wrong type argument: number-or-marker-p, 4294967296
Configured using:
'configure -C --enable-checking --with-modules --enable-check-lisp-object-type
'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign'
PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig'
Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS
GTK3 X11 MODULES THREADS LCMS2 GMP
Important settings:
value of $LANG: fr_CH.UTF-8
locale-coding-system: utf-8-unix
Major mode: InactiveMinibuffer
Minor modes in effect:
diff-auto-refine-mode: t
electric-pair-mode: t
global-reveal-mode: t
reveal-mode: t
auto-insert-mode: t
savehist-mode: t
minibuffer-electric-default-mode: t
global-compact-docstrings-mode: t
url-handler-mode: t
global-eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
global-prettify-symbols-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
/home/monnier/src/emacs/elpa/packages/svg/svg hides /home/monnier/src/emacs/work/lisp/svg
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-mode hides /home/monnier/src/emacs/work/lisp/progmodes/ada-mode
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-stmt hides /home/monnier/src/emacs/work/lisp/progmodes/ada-stmt
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-prj hides /home/monnier/src/emacs/work/lisp/progmodes/ada-prj
/home/monnier/src/emacs/elpa/packages/ada-mode/ada-xref hides /home/monnier/src/emacs/work/lisp/progmodes/ada-xref
/home/monnier/src/emacs/elpa/packages/hyperbole/set hides /home/monnier/src/emacs/work/lisp/emacs-lisp/set
/home/monnier/src/emacs/elpa/packages/landmark/landmark hides /home/monnier/src/emacs/work/lisp/obsolete/landmark
/home/monnier/src/emacs/elpa/packages/crisp/crisp hides /home/monnier/src/emacs/work/lisp/obsolete/crisp
Features:
(gud smerge-mode whitespace vc vc-dispatcher executable copyright
jka-compr lisp-mnt eieio-opt speedbar sb-image ezimage dframe help-fns
radix-tree qp xscheme unsafep trace testcover scheme re-builder profiler
inf-lisp ielm ert find-func ewoc debug elp edebug backtrace cl-indent
misearch multi-isearch cus-edit cus-start cus-load wid-edit vc-git
diff-mode filecache sm-c-mode smie cl-print pp shadow sort mail-extr
emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml
mml-sec epa gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils server time-date
flymake-proc flymake compile comint ansi-color ring warnings noutline
outline easy-mmode flyspell ispell checkdoc thingatpt load-dir elec-pair
reveal autoinsert proof-site proof-autoloads cl pg-vars savehist
minibuf-eldef disp-table compact-docstrings kotl-autoloads advice info
realgud-recursive-autoloads url-auth finder-inf package let-alist
derived pcase cl-extra help-mode easymenu cl-seq inline url-handlers
url-parse auth-source eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars seq byte-opt gv bytecomp byte-compile
cconv epg epg-config subr-x cl-loaddefs cl-lib mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win
x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite
charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev
obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face
macroexp files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote threads
dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)
Memory information:
((conses 8 297615 57471)
(symbols 24 33073 10) (strings 16 75336 4989) (string-bytes 1 2276426)
(vectors 12 43711)
(vector-slots 4 1379492 59400) (floats 8 138 166) (intervals 28 11552 75)
(buffers 536 35))
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#32477: 27.0.50; `=` burps on bignums when compiled
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
0 siblings, 1 reply; 3+ messages in thread
From: Andy Moreton @ 2018-08-20 1:37 UTC (permalink / raw)
To: 32477
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;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#32477: 27.0.50; `=` burps on bignums when compiled
2018-08-20 1:37 ` Andy Moreton
@ 2018-08-20 20:44 ` Pip Cet
0 siblings, 0 replies; 3+ messages in thread
From: Pip Cet @ 2018-08-20 20:44 UTC (permalink / raw)
To: andrewjmoreton; +Cc: 32477
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).
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-20 20:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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.