This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlglossary: Add defn for "code point"
[perl5.git] / scope.c
diff --git a/scope.c b/scope.c
index 2d9e383..5445da9 100644 (file)
--- 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);
     /* 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;
 }