summaryrefslogtreecommitdiff
path: root/malloc_ctl.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-03-13 11:18:38 +0000
committerDavid Mitchell <davem@iabyn.com>2015-03-13 12:26:55 +0000
commitdc3c1c7079dd7767e3d45a651b4fac4a932d25ed (patch)
tree1970b116de66584e44f97dbe74ec597d3b35937e /malloc_ctl.h
parentd210e52092d500e8dcb8c96cb522a103fab67aef (diff)
downloadperl-dc3c1c7079dd7767e3d45a651b4fac4a932d25ed.tar.gz
Perl_multideref_stringify: don't SEGV on null cv
This function is called by e.g. "perl -Dt" to display the multideref op: $ perl -Dt -e'$a->{foo}[1]' ... (-e:1) multideref($a->{"foo"}[1]) On threaded builds, it needs to know the correct pad (and so the correct cv too) so that it can access GVs and const SVs that have been moved to the pad. However with a sort code block (rather than a sort sub), S_deb_curcv() returns null, so multideref_stringify() is called with a null CV. This then SEGVs. Although ideally S_deb_curcv() should be fixed, a function like multideref_stringify(), which can be used for debugging, should be robust in unexpected circumstances. So this commit makes it safe (although not particularly useful) with a null CV: $ perl -Dt -e'@a = sort { $a->[$i] <=> $b->[$i] } [0], [1]' ... (-e:1) sort (-e:1) multideref(<NULLGV>->[<NULLGV>]) (-e:1) multideref(<NULLGV>->[<NULLGV>])
Diffstat (limited to 'malloc_ctl.h')
0 files changed, 0 insertions, 0 deletions