This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest.xs: fixup clone_with_stack()
[perl5.git] / ext / XS-APItest / APItest.xs
index 16a7753..8c44736 100644 (file)
@@ -3725,10 +3725,12 @@ CODE:
     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);
+    PL_scopestack_ix = oldscope;
     FREETMPS;
 
     perl_destruct(interp);