another POPSTACK victim
authorGurusamy Sarathy <gsar@cpan.org>
Thu, 5 Nov 1998 04:40:44 +0000 (04:40 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Thu, 5 Nov 1998 04:40:44 +0000 (04:40 +0000)
p4raw-id: //depot/perl@2201

cop.h
sv.c

diff --git a/cop.h b/cop.h
index 1ef5e0c..043ea8d 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -357,8 +357,8 @@ typedef struct stackinfo PERL_SI;
 
 #define PUSHSTACK PUSHSTACKi(PERLSI_UNKNOWN)
 
-/* POPSTACK works with PL_stack_sp, so any local sp modifications may
- * need to be flushed with a PUTBACK */
+/* POPSTACK works with PL_stack_sp, so it may need to be bracketed by
+ * PUTBACK/SPAGAIN to flush/refresh any local SP that may be active */
 #define POPSTACK \
     STMT_START {                                                       \
        djSP;                                                           \
diff --git a/sv.c b/sv.c
index 9dfa4f6..bd421b6 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -2884,6 +2884,7 @@ sv_clear(register SV *sv)
                                 G_DISCARD|G_EVAL|G_KEEPERR);
                    SvREFCNT(sv)--;
                    POPSTACK;
+                   SPAGAIN;
                    LEAVE;
                }
            } while (SvOBJECT(sv) && SvSTASH(sv) != stash);