Skip to content

Commit c5bbf81

Browse files
committed
peep.c:OP_PADSV_STORE - skip SASSIGN created by Memoize::Once
Memoize::Once produces a non-standard SASSIGN which should not and need not be optimized. Because this SASSIGN has only one child, something that hasn't been seen elsewhere, that can be used as a heuristic for skipping this type of SASSIGN in rpeep().
1 parent 63efc0f commit c5bbf81

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

peep.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3908,8 +3908,12 @@ Perl_rpeep(pTHX_ OP *o)
39083908
!(lval->op_private & OPpDEREF)
39093909
/* skip if padrange has already gazumped the padsv */
39103910
&& (lval == oldop)
3911+
/* Memoize::Once produces a non-standard SASSIGN that
3912+
* doesn't actually point to pp_sassign, has only one
3913+
* child (PADSV), and gets to it via op_other rather
3914+
* than op_next. Don't try to optimize this. */
3915+
&& (lval != rhs)
39113916
) {
3912-
39133917
/* SASSIGN's bitfield flags, such as op_moresib and
39143918
* op_slabbed, will be carried over unchanged. */
39153919
OpTYPE_set(o, OP_PADSV_STORE);

0 commit comments

Comments
 (0)