diff options
-rw-r--r-- | src/lj_strscan.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lj_strscan.c b/src/lj_strscan.c index a21c414a..0fddd43b 100644 --- a/src/lj_strscan.c +++ b/src/lj_strscan.c | |||
@@ -289,14 +289,15 @@ static StrScanFmt strscan_dec(const uint8_t *p, TValue *o, | |||
289 | 289 | ||
290 | /* Scale down until no more than 17 or 18 integer part digits remain. */ | 290 | /* Scale down until no more than 17 or 18 integer part digits remain. */ |
291 | while (idig > 9) { | 291 | while (idig > 9) { |
292 | uint32_t i, cy = 0; | 292 | uint32_t i = hi, cy = 0; |
293 | ex2 += 6; | 293 | ex2 += 6; |
294 | for (i = hi; i != lo; i = DNEXT(i)) { | 294 | do { |
295 | cy += xi[i]; | 295 | cy += xi[i]; |
296 | xi[i] = (cy >> 6); | 296 | xi[i] = (cy >> 6); |
297 | cy = 100 * (cy & 0x3f); | 297 | cy = 100 * (cy & 0x3f); |
298 | if (xi[i] == 0 && i == hi) hi = DNEXT(hi), idig--; | 298 | if (xi[i] == 0 && i == hi) hi = DNEXT(hi), idig--; |
299 | } | 299 | i = DNEXT(i); |
300 | } while (i != lo); | ||
300 | while (cy) { | 301 | while (cy) { |
301 | if (hi == lo) { xi[DPREV(lo)] |= 1; break; } | 302 | if (hi == lo) { xi[DPREV(lo)] |= 1; break; } |
302 | xi[lo] = (cy >> 6); lo = DNEXT(lo); | 303 | xi[lo] = (cy >> 6); lo = DNEXT(lo); |