Mercurial > hg > xemacs-beta
diff src/data.c @ 5905:85fd1ab80057
Fix a bug in #'parse-integer with negative bignums and non-nil JUNK-ALLOWED
src/ChangeLog addition:
2015-05-08 Aidan Kehoe <kehoea@parhasard.net>
* data.c (parse_integer):
Fix a bug here with the interaction of negative bignums and a
non-zero JUNK-ALLOWED argument.
tests/ChangeLog addition:
2015-05-08 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
Check for a bug just fixed with the interaction of negative
bignums and :junk-allowed non-nil.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Fri, 08 May 2015 16:24:57 +0100 |
parents | 5afddd952c46 |
children | 6174848f3e6c |
line wrap: on
line diff
--- a/src/data.c Fri May 08 14:33:46 2015 +0100 +++ b/src/data.c Fri May 08 16:24:57 2015 +0100 @@ -1899,7 +1899,13 @@ if (!NILP (result)) { /* Bignum terminated by whitespace or by non-digit. */ - return Fcanonicalize_number (result); + if (negativland) + { + bignum_set_long (scratch_bignum, -1L); + bignum_mul (XBIGNUM_DATA (result), XBIGNUM_DATA (result), + scratch_bignum); + } + return result; } #endif