This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest.xs: fixup clone_with_stack()
authorDavid Mitchell <davem@iabyn.com>
Fri, 18 Dec 2015 21:33:10 +0000 (21:33 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 09:18:36 +0000 (09:18 +0000)
Make the unwinding and freeing of the old interpreter up to date
with the latest handling of PL_scopestack.

ext/XS-APItest/APItest.xs

index 16a7753..8c44736 100644 (file)
@@ -3725,10 +3725,12 @@ CODE:
     PERL_SET_CONTEXT(interp);
 
     POPSTACK_TO(PL_mainstack);
     PERL_SET_CONTEXT(interp);
 
     POPSTACK_TO(PL_mainstack);
-    assert(cxstack_ix >= 0);
-    dounwind(-1);
-    POPBLOCK(cxstack);
+    if (cxstack_ix >= 0) {
+        dounwind(-1);
+        POPBLOCK(cxstack);
+    }
     LEAVE_SCOPE(0);
     LEAVE_SCOPE(0);
+    PL_scopestack_ix = oldscope;
     FREETMPS;
 
     perl_destruct(interp);
     FREETMPS;
 
     perl_destruct(interp);