summaryrefslogtreecommitdiff
path: root/deb.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-08-24 16:28:00 +0100
committerDavid Mitchell <davem@iabyn.com>2016-08-25 16:03:16 +0100
commit5ef710896f62c2e11e9da401acb3247cd70ee203 (patch)
tree74212f9d15704971b0897ee9dd141dbcfdf27e12 /deb.c
parente312a16a9a796750ffb4cabee5a48b7ff7030437 (diff)
downloadperl-5ef710896f62c2e11e9da401acb3247cd70ee203.tar.gz
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.
Diffstat (limited to 'deb.c')
-rw-r--r--deb.c15
1 files changed, 8 insertions, 7 deletions
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;