You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perl_rpeep: Fix empty else {} optimization in OP_COND_EXPR case
Until `else` blocks were subject to the same block scoping rules as `if`
and `elsif`, an empty `else` block or ternary condition would arrive at
the peephole optimizer as a bare stub OP:
+--null (ex-stub) OP(0x562e555a7310)
FLAGS = (...,PARENS,SLABBED)
Now, it could arrive in that form OR as a SCOPE + NULL:
scope LISTOP(0x5603b282b190)
PARENT ===> 3 [cond_expr 0x5603b282b770]
FLAGS = (VOID,KIDS,SLABBED)
|
+--null (ex-stub) OP(0x5603b282b350) ===> 1 [scope 0x5603b282b190]
FLAGS = (VOID,SLABBED)
This commit updates the "empty else" optimization on `OP_COND_EXPR`s so
that the OPs associated with empty "else" conditions are removed (when
not in scalar context) regardless of which form they arrive in.
0 commit comments