File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -985,9 +985,10 @@ lexer_parse_number (void)
985985 const lit_utf8_byte_t *fp_buf_p = TOK_START ();
986986 /* token is constructed at end of function */
987987
988- for (i = 0 ; i < tok_length; i++)
988+ ecma_number_t mult = 1 .0f ;
989+ for (i = tok_length; i > 0 ; i--, mult *= 10 )
989990 {
990- fp_res = fp_res * 10 + (ecma_number_t ) lit_char_hex_to_int (fp_buf_p[i]) ;
991+ fp_res += (ecma_number_t ) lit_char_hex_to_int (fp_buf_p[i - 1 ]) * mult ;
991992 }
992993 }
993994 }
Original file line number Diff line number Diff line change @@ -22,3 +22,5 @@ assert(big == 2147483648); // overflow on 32bit numbers
2222
2323big ++ ;
2424assert ( big == 2147483649 ) ; // overflow on 32bit numbers
25+
26+ assert ( ( 1152921504606846900 ) . toString ( ) === "1152921504606847000" )
You can’t perform that action at this time.
0 commit comments