If PL_curpm is pointing to an op that is getting freed, reset it to
authorNicholas Clark <nick@ccl4.org>
Tue, 10 Apr 2007 11:48:07 +0000 (11:48 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 10 Apr 2007 11:48:07 +0000 (11:48 +0000)
NULL. Otherwise we have a pointer dangling into undefined behaviour.

p4raw-id: //depot/perl@30888

op.c

diff --git a/op.c b/op.c
index fc1ea70..efe5611 100644 (file)
--- a/op.c
+++ b/op.c
@@ -663,6 +663,8 @@ S_forget_pmop(pTHX_ PMOP *const o, U32 flags)
            }
        }
     }
+    if (PL_curpm == o) 
+       PL_curpm = NULL;
     if (flags)
        PmopSTASH_free(o);
 }