summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2004-05-06 17:19:17 +0000
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2004-05-06 17:19:17 +0000
commit922c43655b68a766f6d1b8a30cddd076db7b54d7 (patch)
tree30553b54b83c0ae4ee0295705eca433ea3cc15c8 /pp.c
parent772ab6503ff18dfd6856d3c039bc0c327944f3f1 (diff)
downloadperl-922c43655b68a766f6d1b8a30cddd076db7b54d7.tar.gz
[perl #29346] Double warning for int(undef) and abs(undef)
Remove the duplicate warnings and update tests. p4raw-id: //depot/perl@22796
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 4ce78678db..60eaf2867a 100644
--- a/pp.c
+++ b/pp.c
@@ -2800,7 +2800,9 @@ PP(pp_int)
else preferring IV has introduced a subtle behaviour change bug. OTOH
relying on floating point to be accurate is a bug. */
- if (SvIOK(TOPs)) {
+ if (!SvOK(TOPs))
+ SETu(0);
+ else if (SvIOK(TOPs)) {
if (SvIsUV(TOPs)) {
UV uv = TOPu;
SETu(uv);
@@ -2834,7 +2836,9 @@ PP(pp_abs)
/* This will cache the NV value if string isn't actually integer */
IV iv = TOPi;
- if (SvIOK(TOPs)) {
+ if (!SvOK(TOPs))
+ SETu(0);
+ else if (SvIOK(TOPs)) {
/* IVX is precise */
if (SvIsUV(TOPs)) {
SETu(TOPu); /* force it to be numeric only */