obscure SEGV [FIX]

[email protected] (Joshua N Pritikin)
Newsgroups perl.loop
Message-ID <[email protected]>
==== //depot/D/Event/ChangeLog#164 - /cache/D/Event/ChangeLog ====
--- /tmp/tmp.5742.0	Fri May 19 10:42:52 2000
+++ /cache/D/Event/ChangeLog	Fri May 19 10:37:03 2000
@@ -1,3 +1,8 @@
+2000-05-19  Joshua Pritikin  <[email protected]>
+
+	* Fix SEGV triggered when Event-Stats is enabled while loop is
+ 	nested.
+
 2000-05-12  Joshua Pritikin  <[email protected]>
 
 	* Release 0.77.
==== //depot/D/Event/c/ev.c#17 - /cache/D/Event/c/ev.c ====
--- /tmp/tmp.5742.1	Fri May 19 10:42:52 2000
+++ /cache/D/Event/c/ev.c	Fri May 19 10:33:09 2000
@@ -155,8 +155,13 @@
 	    Estat.scrub(fp->stats, wa);
 	    fp->stats = 0;
 	}
-	if (CurCBFrame >= 0)
-	    Estat.resume((CBFrame + CurCBFrame)->stats);
+	if (CurCBFrame >= 0) {
+	    pe_cbframe *pfp = CBFrame + CurCBFrame;
+	    if (!pfp->stats)
+		pfp->stats = Estat.enter(CurCBFrame, pfp->ev->up->max_cb_tm);
+	    else
+		Estat.resume(pfp->stats);
+	}
     }
     /* this must be last because it can destroy the watcher */
     pe_event_release(ev);

-- 
"Never ascribe to malice that which can be explained by stupidity."
                           via, but not speaking for Deutsche Bank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.