diff options
author | Mike Pall <mike> | 2012-08-27 14:26:50 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-08-27 14:26:50 +0200 |
commit | 1e477e648795e7c93460ae420eb541a15361b780 (patch) | |
tree | dc719005e47d9ba923e4e5162caa8281070261f3 | |
parent | 774280d9c10315cc2968868128a7eeeacc5c3a30 (diff) | |
download | luajit-1e477e648795e7c93460ae420eb541a15361b780.tar.gz luajit-1e477e648795e7c93460ae420eb541a15361b780.tar.bz2 luajit-1e477e648795e7c93460ae420eb541a15361b780.zip |
Fix underflow handling in builtin string to number conversion.
-rw-r--r-- | src/lj_strscan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_strscan.c b/src/lj_strscan.c index 31189ae7..1e4b235c 100644 --- a/src/lj_strscan.c +++ b/src/lj_strscan.c | |||
@@ -266,7 +266,7 @@ static StrScanFmt strscan_dec(const uint8_t *p, TValue *o, | |||
266 | 266 | ||
267 | /* Handle simple overflow/underflow. */ | 267 | /* Handle simple overflow/underflow. */ |
268 | if (idig > 310/2) { if (neg) setminfV(o); else setpinfV(o); return fmt; } | 268 | if (idig > 310/2) { if (neg) setminfV(o); else setpinfV(o); return fmt; } |
269 | else if (idig < -326/2) { o->n = 0.0; return fmt; } | 269 | else if (idig < -326/2) { o->n = neg ? -0.0 : 0.0; return fmt; } |
270 | 270 | ||
271 | /* Scale up until we have at least 17 or 18 integer part digits. */ | 271 | /* Scale up until we have at least 17 or 18 integer part digits. */ |
272 | while (idig < 9 && idig < DLEN(lo, hi)) { | 272 | while (idig < 9 && idig < DLEN(lo, hi)) { |