fix too-early exact->inexact conversion in number parsing

Robby found this bug, continuing his streak that included
find the bugs behind commits f5dbd99e43 and 901ffdcbac.
This commit is contained in:
Matthew Flatt 2015-11-22 09:08:22 -07:00
parent 2a88662d01
commit ce7487182a
2 changed files with 7 additions and 2 deletions

View File

@ -54,6 +54,9 @@
(1e-134
"0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001")
(-0.0 "-632.3206524753840966914228247597079196012717570277972845484e-399")
(1e-300
;; check e->i only after division is performed
"#i500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000")
(10.0 "1#")
(10.0 "1#e0")
(10.0 "1####e-3")

View File

@ -1582,7 +1582,8 @@ Scheme_Object *scheme_read_number(const mzchar *str, intptr_t len,
first[has_slash - delta] = 0;
n1 = scheme_read_number(first, has_slash - delta,
is_float, is_not_float, 1,
/* recur without is_float to keep all precision */
0, is_not_float, 1,
radix, 1, next_complain,
div_by_zero,
test_only,
@ -1606,7 +1607,8 @@ Scheme_Object *scheme_read_number(const mzchar *str, intptr_t len,
#endif
n2 = scheme_read_number(substr, len - has_slash - 1,
is_float, is_not_float, 1,
/* recur without is_float to keep all precision */
0, is_not_float, 1,
radix, 1, next_complain,
div_by_zero,
test_only,