diff options
author | Chip Salzenberg <chip@pobox.com> | 2010-07-27 20:45:41 -0700 |
---|---|---|
committer | Chip Salzenberg <chip@pobox.com> | 2010-07-27 20:45:41 -0700 |
commit | 395b8e2d02eadc9b0639534410c39c530bc8a33d (patch) | |
tree | 464dbb27bd52bddbf44dbd709291b3bf505f4fb5 /scope.c | |
parent | 1266f6a243b5c49226a55a1f60d6fa0ce69e5b1a (diff) | |
download | perl-395b8e2d02eadc9b0639534410c39c530bc8a33d.tar.gz |
Fix off-by-one: avoid allocating an extra context
(patch req by Nicholas)
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -77,10 +77,10 @@ Perl_cxinc(pTHX) dVAR; const IV old_max = cxstack_max; cxstack_max = GROW(cxstack_max); - Renew(cxstack, cxstack_max + 1, PERL_CONTEXT); /* XXX should fix CXINC macro */ + Renew(cxstack, cxstack_max, PERL_CONTEXT); /* Without any kind of initialising deep enough recursion * will end up reading uninitialised PERL_CONTEXTs. */ - PoisonNew(cxstack + old_max + 1, cxstack_max - old_max, PERL_CONTEXT); + PoisonNew(cxstack + old_max, cxstack_max - old_max, PERL_CONTEXT); return cxstack_ix + 1; } |