Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[perl #113486] pp_ctl.c: Don’t assume CopSTASH is a hash
Calling HvNAME_HEK on something that is not a hash will result in a crash if it happens to have the SvOOK flag on, because then it tries to read to the end of HvARRAY, which may not even be a valid pointer. This can happen with this convoluted test case: { package foo; sub bar { main::bar() } } sub bar { delete $::{"foo::"}; my $x = \($1+2); my $y = \($1+2); # this is the one that reuses the mem addr, but my $z = \($1+2); # try the others just in case s/2// for $$x, $$y, $$z; # now SvOOK warn scalar caller }; foo::bar This commit only partially fixes ticket #113486, by eliminating the crash. We still have the problem of an unrelated stash reus- ing the SV.
- Loading branch information