1 May 2010 01:02
bug#6069: 23.1.96; sxhash, big uints and overflow-error in custom-file
David Reitter <reitter <at> cmu.edu>
2010-04-30 23:02:53 GMT
2010-04-30 23:02:53 GMT
Not sure if this is an error of Emacs, or if the fault is mine: - `sxhash' of some object produced a 32-bit unsigned integer, which was represented just fine in Lisp. - I stored it in a customization variable, which was subsequently saved to my custom-file. - When reading back the file, I got an overflow error, as in (read-from-string "2475893479") --> overflow error Due to the nature of hashes, it appears unreasonable hard for me to make a test case. But looking at the code, sxhash is designed to produce an unsigned int and make a (signed?) Lisp integer from it. INTMASK is 0xffffffff at least on my system. Artihmetic operations, OTOH convert big ints to floats in arith_driver(): (let ((bigint (+ 1475893479 1000000000))) (floatp bigint)) (Would sxhash in that case produce a negative value if its result is printed? I don't know. Somewhere along the way to `custom-save-variables', some info about the meaning of bit #31 gets lost, and Emacs produces string representation that can't be read.) In GNU Emacs 23.1.96.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54) of 2010-04-30 on braeburn.aquamacs.org - Aquamacs Distribution 2.0preview6 Windowing system distributor `Apple', version 10.3.1038 configured using `configure '--with-ns' '--without-x' 'CFLAGS=-arch i386 -arch ppc' 'LDFLAGS=-arch i386 -arch ppc''(Continue reading)
RSS Feed