Win32 crash in fork.t (perl@16694)
Kevin Chase [Mon, 20 May 2002 17:02:16 +0000 (10:02 -0700)]
From: "Kevin Chase" <kevincha99@hotmail.com>
Message-ID: <F53z5b6KZmcK8r6beUz000008f7@hotmail.com>

It looks that the Poison() found its first target.
The suggested patch is fine.

p4raw-id: //depot/perl@16724

cop.h

diff --git a/cop.h b/cop.h
index bee1b6a..81733e9 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -241,12 +241,16 @@ struct block_loop {
 #  define CX_ITERDATA_SET(cx,idata)                                    \
        cx->blk_loop.oldcurpad = PL_curpad;                             \
        if ((cx->blk_loop.iterdata = (idata)))                          \
-           cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx));
+           cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx));       \
+       else                                                            \
+           cx->blk_loop.itersave = Nullsv;
 #else
 #  define CxITERVAR(c)         ((c)->blk_loop.itervar)
 #  define CX_ITERDATA_SET(cx,ivar)                                     \
        if ((cx->blk_loop.itervar = (SV**)(ivar)))                      \
-           cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx));
+           cx->blk_loop.itersave = SvREFCNT_inc(*CxITERVAR(cx));       \
+       else                                                            \
+           cx->blk_loop.itersave = Nullsv;
 #endif
 
 #define PUSHLOOP(cx, dat, s)                                           \