summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-27 06:48:04 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-27 06:48:51 -0700
commit354b74ae6f54fdd18bcf40fc3afcdaddc8b2ca9d (patch)
tree89a0523c3d34a032b5b3daa08aaeffe4e2576f3b /pp.c
parent6625b4731a37f834cd655039c5b8c19bbed23dba (diff)
downloadperl-354b74ae6f54fdd18bcf40fc3afcdaddc8b2ca9d.tar.gz
[perl #12285] Fix str vs num inf/nan treatment
sprintf, pack and chr were treating 0+"Inf" and "Inf" differently, even though they have the same string and numeric values. pack was also croaking for 0+"Inf" passed to a string format.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index f67b7ccd44..cf9f6b7e06 100644
--- a/pp.c
+++ b/pp.c
@@ -3394,7 +3394,7 @@ PP(pp_chr)
SV *top = POPs;
SvGETMAGIC(top);
- if (SvNOK(top) && UNLIKELY(Perl_isinfnan(SvNV(top))))
+ if (UNLIKELY(Perl_isinfnansv(top)))
Perl_croak(aTHX_ "Cannot chr %"NVgf, SvNV(top));
else {
if (!IN_BYTES /* under bytes, chr(-1) eq chr(0xff), etc. */