diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-15 19:17:06 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-12-15 19:17:06 +0000 |
commit | 28e5dec85047e189010079efa89eed07bc9eddc8 (patch) | |
tree | dd941df355c40cba395e514551ea847e8d07edfd /op.c | |
parent | c11ecd62a73b5b39df29fd460e1c4451c6e0e8af (diff) | |
download | perl-28e5dec85047e189010079efa89eed07bc9eddc8.tar.gz |
Return of the IVUV-preservation, now seems to be happy even
in Digital UNIX (the broken strtoul brokenness detection
seems to have been the fly in the ointment).
p4raw-id: //depot/perl@8138
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -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); } |