X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=op.c;h=e6f7804e9daef98c0abcadd56c084648d0cd1238;hb=28e5dec85047e189010079efa89eed07bc9eddc8;hp=b6a9c7c04f801b9b2d986fc0cec5a955625238b3;hpb=c11ecd62a73b5b39df29fd460e1c4451c6e0e8af;p=p5sagit%2Fp5-mst-13.2.git diff --git a/op.c b/op.c index b6a9c7c..e6f7804 100644 --- a/op.c +++ b/op.c @@ -2249,13 +2249,11 @@ Perl_fold_constants(pTHX_ register OP *o) if ((SvFLAGS(sv) & (SVf_IOK|SVf_NOK|SVf_POK)) == SVf_NOK && type != OP_NEGATE) { - IV iv = SvIV(sv); - if ((NV)iv == SvNV(sv)) { - SvREFCNT_dec(sv); - sv = newSViv(iv); - } - else - SvIOK_off(sv); /* undo SvIV() damage */ +#ifdef PERL_PRESERVE_IVUV + /* Only bother to attempt to fold to IV if + most operators will benefit */ + SvIV_please(sv); +#endif } return newSVOP(OP_CONST, 0, sv); }