summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-06-23 07:08:24 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-07-25 23:48:00 -0700
commit2484f8dbbb584bb7bc7107e23ebd49f694eb3ea2 (patch)
tree70cc9582216e85b9e6499e674cb7d2a77dae7b88 /op.c
parent8e079c2a69673209538b040ae2389f2248682dd9 (diff)
downloadperl-2484f8dbbb584bb7bc7107e23ebd49f694eb3ea2.tar.gz
Stop folding of ops from changing mutability
If $a+$b produces a mutable value, then so should 1+2.
Diffstat (limited to 'op.c')
-rw-r--r--op.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/op.c b/op.c
index dc8cf222c2..cfbe11ce62 100644
--- a/op.c
+++ b/op.c
@@ -3333,6 +3333,7 @@ S_fold_constants(pTHX_ OP *o)
op_free(o);
#endif
assert(sv);
+ if (!SvIMMORTAL(sv)) SvPADTMP_on(sv);
if (type == OP_RV2GV)
newop = newGVOP(OP_GV, 0, MUTABLE_GV(sv));
else