commit d44ca5baac54e36a08cfb1b122e5d0c6c0b194b7 (tree)
parent 6e6d138c2f50f95fe9c6b4acbc16ffa17475a4a5
Author: Andrew Kelley <superjoe30@gmail.com>
Date: Mon, 29 Aug 2016 22:19:59 -0700
tokenizer: add missing return statement on float overflow
closes #177
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp
@@ -320,6 +320,7 @@ static void end_float_token(Tokenize *t) {
t->exponent_in_bin_or_dec += significand_magnitude_in_bin;
if (!(-1023 <= t->exponent_in_bin_or_dec && t->exponent_in_bin_or_dec < 1023)) {
t->cur_tok->data.num_lit.overflow = true;
+ return;
} else {
// this should chop off exactly one 1 bit from the top.
significand_bits = ((uint64_t)significand << (52 - significand_magnitude_in_bin)) & 0xfffffffffffffULL;