comparison src/data.c @ 5886:c96000075e49

Be more careful about C integer overflow, #'parse-integer. src/ChangeLog addition: 2015-04-08 Aidan Kehoe <kehoea@parhasard.net> * data.c (parse_integer): Fix a bug in my detecting a C overflow here. tests/ChangeLog addition: 2015-04-08 Aidan Kehoe <kehoea@parhasard.net> * automated/lisp-tests.el: Add a couple of tests for #'parse-integer to check for a bug just fixed.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 08 Apr 2015 21:03:18 +0100
parents 0cebf04c18b5
children 5afddd952c46
comparison
equal deleted inserted replaced
5885:c8bbb32fe124 5886:c96000075e49
1778 goto loser; 1778 goto loser;
1779 } 1779 }
1780 1780
1781 onum = num; 1781 onum = num;
1782 num *= base; 1782 num *= base;
1783 if (num > fixnum_limit) 1783 if (num > fixnum_limit || num < onum)
1784 { 1784 {
1785 goto overflow; 1785 goto overflow;
1786 } 1786 }
1787 1787
1788 num += cint; 1788 num += cint;