This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_return: avoid potential CX stack realloc prob
[perl5.git] / pp_ctl.c
index 1a2b0f7..00b9e02 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2487,6 +2487,7 @@ PP(pp_return)
                             cx->blk_gimme, SVs_TEMP|SVs_PADTMP, TRUE);
         SPAGAIN;
        dounwind(cxix);
+        cx = &cxstack[cxix]; /* CX stack may have been realloced */
     }
     else {
         /* Like in the branch above, we need to handle any extra junk on