Fix SEGV when debugging with foreach() lvalue patch
authorIlya Zakharevich <ilya@math.ohio-state.edu>
Thu, 27 Feb 1997 19:24:36 +0000 (14:24 -0500)
committerChip Salzenberg <chip@atlantic.net>
Tue, 25 Feb 1997 01:12:02 +0000 (13:12 +1200)
p5p-msgid: <199702271924.OAA14557@monk.mps.ohio-state.edu>

sv.c

diff --git a/sv.c b/sv.c
index 65d7d30..8f6bbe9 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -2624,6 +2624,9 @@ register SV *sv;
                sv_upgrade(&ref, SVt_RV);
                SvRV(&ref) = SvREFCNT_inc(sv);
                SvROK_on(&ref);
+               SvREFCNT(&ref) = 1;     /* Fake, but otherwise
+                                          creating+destructing a ref
+                                          leads to disaster. */
 
                EXTEND(SP, 2);
                PUSHMARK(SP);