summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-04-10 11:48:07 +0000
committerNicholas Clark <nick@ccl4.org>2007-04-10 11:48:07 +0000
commit1cdf7faf9fb9e7feb64bb63a4448c8361e406417 (patch)
treeca439d5b230acdd825acd3c71fbc4acd78b638b0 /op.c
parent154a3f59ee199673e70f3fe43432e9d672630a16 (diff)
downloadperl-1cdf7faf9fb9e7feb64bb63a4448c8361e406417.tar.gz
If PL_curpm is pointing to an op that is getting freed, reset it to
NULL. Otherwise we have a pointer dangling into undefined behaviour. p4raw-id: //depot/perl@30888
Diffstat (limited to 'op.c')
-rw-r--r--op.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/op.c b/op.c
index fc1ea7066c..efe5611a62 100644
--- 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);
}