Skip to content

Commit 4c09c43

Browse files
committed
signatures: don't leak an OP_NULL for a '$ =' sigscalarelem
Fixes #23187
1 parent 3862d0f commit 4c09c43

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

op.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16550,6 +16550,9 @@ Perl_subsignature_append_positional(pTHX_ OP *varop, OPCODE defmode, OP *defexpr
1655016550

1655116551
if(defexpr->op_type == OP_NULL && !(defexpr->op_flags & OPf_KIDS))
1655216552
{
16553+
/* newOP(OP_NULL, 0) in the caller */
16554+
op_free(defexpr);
16555+
1655316556
/* handle '$=' special case */
1655416557
if(varop)
1655516558
yyerror("Optional parameter lacks default expression");

0 commit comments

Comments
 (0)