diff options
-rw-r--r-- | op.c | 2 | ||||
-rw-r--r-- | t/op/lexsub.t | 6 |
2 files changed, 7 insertions, 1 deletions
@@ -11238,7 +11238,7 @@ Perl_find_lexical_cv(pTHX_ PADOFFSET off) CV *compcv = PL_compcv; while (PadnameOUTER(name)) { assert(PARENT_PAD_INDEX(name)); - compcv = CvOUTSIDE(PL_compcv); + compcv = CvOUTSIDE(compcv); name = PadlistNAMESARRAY(CvPADLIST(compcv)) [off = PARENT_PAD_INDEX(name)]; } diff --git a/t/op/lexsub.t b/t/op/lexsub.t index b1b76e84c3..adccf4c5db 100644 --- a/t/op/lexsub.t +++ b/t/op/lexsub.t @@ -961,3 +961,9 @@ like runperl( @AutoloadTest::ISA = AutoloadTestSuper::; AutoloadTest->blah; } + +# This used to crash because op.c:find_lexical_cv was looking at the wrong +# CV’s OUTSIDE pointer. [perl #124099] +{ + my sub h; sub{my $x; sub{h}} +} |