Skip to content

Commit da662ca

Browse files
committed
Revert "Perl_op_convert_list - only short circuit CONST OPs with an IsCOW SV"
This reverts commit 80d3e79. That commit was always intended as a stopgap to be replaced by b1f270f. The history behind this was as follows: * GH#22116 - a902d92 - short-circuited constant folding on CONST OPs, as this should be unnecessary. However, Dave Mitchell noticed that it had the inadvertent effect of disabling COW on SVs holding UTF8 string literals (e.g. `"\x{100}abcd"`). * b1f270f always seemed like the best fix, but given the apparent proximity to the 5.42 release date that commit seemed to be too big a change. * GH#23296 brought in the now-reverted commit as a stop gap that retained some of the older, now-unnecessary behaviour.
1 parent 5439543 commit da662ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

op.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5582,7 +5582,7 @@ Perl_op_convert_list(pTHX_ I32 type, I32 flags, OP *o)
55825582
flags |= OPf_SPECIAL;
55835583
}
55845584
if (type == OP_STRINGIFY && OP_TYPE_IS(o, OP_CONST) &&
5585-
!(flags & OPf_FOLDED) && SvIsCOW(cSVOPx_sv(o)) ){
5585+
!(flags & OPf_FOLDED) ) {
55865586
assert(!OpSIBLING(o));
55875587
/* Don't wrap a single CONST in a list, process that list,
55885588
* then constant fold the list back to the starting OP.

0 commit comments

Comments
 (0)