mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 07:34:07 +00:00
Fix underflow handling in builtin string to number conversion.
This commit is contained in:
parent
774280d9c1
commit
1e477e6487
@ -266,7 +266,7 @@ static StrScanFmt strscan_dec(const uint8_t *p, TValue *o,
|
|||||||
|
|
||||||
/* Handle simple overflow/underflow. */
|
/* Handle simple overflow/underflow. */
|
||||||
if (idig > 310/2) { if (neg) setminfV(o); else setpinfV(o); return fmt; }
|
if (idig > 310/2) { if (neg) setminfV(o); else setpinfV(o); return fmt; }
|
||||||
else if (idig < -326/2) { o->n = 0.0; return fmt; }
|
else if (idig < -326/2) { o->n = neg ? -0.0 : 0.0; return fmt; }
|
||||||
|
|
||||||
/* Scale up until we have at least 17 or 18 integer part digits. */
|
/* Scale up until we have at least 17 or 18 integer part digits. */
|
||||||
while (idig < 9 && idig < DLEN(lo, hi)) {
|
while (idig < 9 && idig < DLEN(lo, hi)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user