summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@pobox.com>2010-07-27 23:40:56 -0700
committerChip Salzenberg <chip@pobox.com>2010-07-27 23:40:56 -0700
commit109bf713de022d5340396fd57331bb452da6e986 (patch)
treed847cb77c3e3538f3202231d18def7d2889befcd /scope.c
parent395b8e2d02eadc9b0639534410c39c530bc8a33d (diff)
downloadperl-109bf713de022d5340396fd57331bb452da6e986.tar.gz
Revert "Fix off-by-one: avoid allocating an extra context"
This reverts commit 395b8e2d02eadc9b0639534410c39c530bc8a33d. The fencepost error is coming from inside the programmer!
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/scope.c b/scope.c
index 2d9e3834f2..92e952360d 100644
--- a/scope.c
+++ b/scope.c
@@ -77,10 +77,10 @@ Perl_cxinc(pTHX)
dVAR;
const IV old_max = cxstack_max;
cxstack_max = GROW(cxstack_max);
- Renew(cxstack, cxstack_max, PERL_CONTEXT);
+ Renew(cxstack, cxstack_max + 1, PERL_CONTEXT); /* XXX should fix CXINC macro */
/* Without any kind of initialising deep enough recursion
* will end up reading uninitialised PERL_CONTEXTs. */
- PoisonNew(cxstack + old_max, cxstack_max - old_max, PERL_CONTEXT);
+ PoisonNew(cxstack + old_max + 1, cxstack_max - old_max, PERL_CONTEXT);
return cxstack_ix + 1;
}