Fix minor flagging bug in op.c:fold_constants
authorFather Chrysostomos <sprout@cpan.org>
Sun, 15 Sep 2013 22:55:19 +0000 (15:55 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 16 Sep 2013 15:25:35 +0000 (08:25 -0700)
Nothing is making use of this in at present in the affected cases.
What this code does is mark an op as being folded so that 1+2 can
be distinguished from 3.  qq"foo" was erroneously being marked as
folded, unlike "foo".  Constant folding is part of the way that
quote-like operators are implemented.  Conceptually there is no
folding here, so we should pretend it did not happen.  This was a
partial cause of bug #116086.

op.c

diff --git a/op.c b/op.c
index 87e3403..2008cf1 100644 (file)
--- a/op.c
+++ b/op.c
@@ -3440,7 +3440,7 @@ S_fold_constants(pTHX_ OP *o)
     else
     {
        newop = newSVOP(OP_CONST, 0, MUTABLE_SV(sv));
-       newop->op_folded = 1;
+       if (type != OP_STRINGIFY) newop->op_folded = 1;
     }
     op_getmad(o,newop,'f');
     return newop;