diff options
author | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2004-05-06 17:19:17 +0000 |
---|---|---|
committer | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2004-05-06 17:19:17 +0000 |
commit | 922c43655b68a766f6d1b8a30cddd076db7b54d7 (patch) | |
tree | 30553b54b83c0ae4ee0295705eca433ea3cc15c8 /pp.c | |
parent | 772ab6503ff18dfd6856d3c039bc0c327944f3f1 (diff) | |
download | perl-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.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 */ |