summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-07-29 14:02:50 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-07-29 14:02:50 +0000
commit9e24b6e2f422a9f67d0605cdea60de0c597868f3 (patch)
treea1d7aa4afcc1f20f6f872172f9f2673776d0e2f6 /pp.c
parent9429f27a525401f243c383770a5f171eef0929c3 (diff)
downloadperl-9e24b6e2f422a9f67d0605cdea60de0c597868f3.tar.gz
Repent and make overly large integerish
constants non-fatal. They are now promoted to NVs, accompanied by an overflow warning that is by default on. p4raw-id: //depot/cfgperl@3832
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/pp.c b/pp.c
index 770b07d8bb..18c875bb55 100644
--- a/pp.c
+++ b/pp.c
@@ -1885,14 +1885,14 @@ PP(pp_hex)
STRLEN n_a;
tmps = POPpx;
- XPUSHu(scan_hex(tmps, sizeof(UV) * 2 + 1, &argtype));
+ XPUSHn(scan_hex(tmps, 99, &argtype));
RETURN;
}
PP(pp_oct)
{
djSP; dTARGET;
- UV value;
+ NV value;
I32 argtype;
char *tmps;
STRLEN n_a;
@@ -1900,15 +1900,15 @@ PP(pp_oct)
tmps = POPpx;
while (*tmps && isSPACE(*tmps))
tmps++;
- /* Do not eat the leading 0[bx] because we need them
- * to detect malformed binary and hexadecimal numbers. */
- if ((tmps[0] == '0' && tmps[1] == 'x') || tmps[0] == 'x')
- value = scan_hex(tmps, sizeof(UV) * 2 + 1, &argtype);
- else if ((tmps[0] == '0' && tmps[1] == 'b') || tmps[0] == 'b')
- value = scan_bin(tmps, sizeof(UV) * 8 + 1, &argtype);
+ if (*tmps == '0')
+ tmps++;
+ if (*tmps == 'x')
+ value = scan_hex(++tmps, 99, &argtype);
+ else if (*tmps == 'b')
+ value = scan_bin(++tmps, 99, &argtype);
else
- value = scan_oct(tmps, sizeof(UV) * 4 + 1, &argtype);
- XPUSHu(value);
+ value = scan_oct(tmps, 99, &argtype);
+ XPUSHn(value);
RETURN;
}