File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -4976,14 +4976,11 @@ S_fold_constants(pTHX_ OP *const o)
49764976 is_stringify = type == OP_STRINGIFY && !o->op_folded;
49774977 op_free(o);
49784978 assert(sv);
4979- if (is_stringify)
4980- SvPADTMP_off(sv);
4981- else if (!SvIMMORTAL(sv)) {
4982- SvPADTMP_on(sv);
4983- /* Do not set SvREADONLY(sv) here. newSVOP will call
4984- * Perl_ck_svconst, which will do it. Setting it early
4985- * here prevents Perl_ck_svconst from setting SvIsCOW(sv).*/
4986- }
4979+ /* sv may have swiped the TARG from a PADTMP OP, but that flag
4980+ * should be off when sv is attached to the new CONST OP. */
4981+ SvPADTMP_off(sv);
4982+ /* Perl_ck_svconst will try to set READONLY and IsCOW flags on
4983+ * sv as part of the new CONST OP creation. */
49874984 newop = newSVOP(OP_CONST, 0, MUTABLE_SV(sv));
49884985 if (!is_stringify) newop->op_folded = 1;
49894986 return newop;
You can’t perform that action at this time.
0 commit comments