summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-06 01:40:43 +0000
committerZefram <zefram@fysh.org>2017-12-06 01:40:43 +0000
commit7c6e7cf06853eef1d1b271077c402c5f8655fbe6 (patch)
treedba122c2b78c8294bba96179d51e2ebcdbb3ddb5 /toke.c
parentc86de4c07d8483411299c7c5d7d78f4fdaa4b225 (diff)
downloadperl-7c6e7cf06853eef1d1b271077c402c5f8655fbe6.tar.gz
avoid negative shift in scan_num()
Lengthy binaryish floating point literals used to perform illegal bit shifts. Ignore digits that are past the end of the significand at an earlier stage to avoid this. Code fix by Tony C. Fixes [perl #131894].
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index 0b3e2aaf76..3baa520131 100644
--- a/toke.c
+++ b/toke.c
@@ -11091,7 +11091,7 @@ Perl_scan_num(pTHX_ const char *start, YYSTYPE* lvalp)
hexfp_uquad <<= shift;
hexfp_uquad |= b;
hexfp_frac_bits += shift;
- } else {
+ } else if (significant_bits - shift < NV_MANT_DIG) {
/* We are at a hexdigit either at,
* or straddling, the edge of mantissa.
* We will try grabbing as many as