Skip to content

Commit

Permalink
perly LSTOPSUB: prevent a double op free between parse stack and CV
Browse files Browse the repository at this point in the history
The reeproducer resulted in the "block" OP being both on the parser
stack and attacked to the CV.  If an error occurred while parsing the
rest of the list operator clean up would release the OP as attached
to the CV, and the same OP on the parse stack, resulting in a double
free.

It's unclear to me whether bison is intended to support modifying
the parse stack entry like this, but it appears to work here.

Fixes Perl#21724
  • Loading branch information
tonycoz committed Apr 10, 2024
1 parent d15f6e9 commit 526b4e9
Show file tree
Hide file tree
Showing 6 changed files with 1,199 additions and 908 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -6066,6 +6066,7 @@ t/lib/croak/class Test croak calls from class.c
t/lib/croak/gv Test croak calls from gv.c
t/lib/croak/mg Test croak calls from mg.c
t/lib/croak/op Test croak calls from op.c
t/lib/croak/parser Test parser errors
t/lib/croak/pp Test croak calls from pp.c
t/lib/croak/pp_ctl Test croak calls from pp_ctl.c
t/lib/croak/pp_hot Test croak calls from pp_hot.c
Expand Down
Loading

0 comments on commit 526b4e9

Please sign in to comment.