From 5ef710896f62c2e11e9da401acb3247cd70ee203 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Wed, 24 Aug 2016 16:28:00 +0100 Subject: Perl_deb_stack_all() - handle CXt_SUBST better RT #129029 There's a loop which skips CXt_SUBST context entries - but it wasn't checking that the *current* cx is that type, but instead was always checking the base cx and was effectively a noop Also fixup a few code comments in that function. --- deb.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'deb.c') diff --git a/deb.c b/deb.c index 02a0a7d17c..e5b03849f1 100644 --- a/deb.c +++ b/deb.c @@ -234,7 +234,7 @@ Perl_deb_stack_all(pTHX) PerlIO_printf(Perl_debug_log, "\n"); else { - /* Find the the current context's stack range by searching + /* Find the current context's stack range by searching * forward for any higher contexts using this stack; failing * that, it will be equal to the size of the stack for old * stacks, or PL_stack_sp for the current stack @@ -244,13 +244,14 @@ Perl_deb_stack_all(pTHX) const PERL_CONTEXT *cx_n = NULL; const PERL_SI *si_n; - /* there's a separate stack per SI, so only search - * this one */ + /* there's a separate argument stack per SI, so only + * search this one */ for (i=ix+1; i<=si->si_cxix; i++) { - if (CxTYPE(cx) == CXt_SUBST) + const PERL_CONTEXT *this_cx = &(si->si_cxstack[i]); + if (CxTYPE(this_cx) == CXt_SUBST) continue; - cx_n = &(si->si_cxstack[i]); + cx_n = this_cx; break; } @@ -266,8 +267,8 @@ Perl_deb_stack_all(pTHX) stack_max = AvFILLp(si->si_stack); } - /* for the other stack types, there's only one stack - * shared between all SIs */ + /* for the markstack, there's only one stack shared + * between all SIs */ si_n = si; i = ix; -- cgit v1.2.1