This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
376ccf8
)
Set PL_curcop to NULL in op.c:S_cop_free
author
Father Chrysostomos
<sprout@cpan.org>
Sat, 10 Aug 2013 17:41:11 +0000
(10:41 -0700)
committer
Father Chrysostomos
<sprout@cpan.org>
Sun, 11 Aug 2013 17:53:34 +0000
(10:53 -0700)
Having PL_curcop pointing to a freed op is a Bad Idea and something
that has caused bugs in the past.
The intent of commit
1df5f7c195
was to do this, but this part of
the commit was accidentally omitted.
See <
20130805200313
.GS3729@plum.flirble.org>.
op.c
patch
|
blob
|
blame
|
history
diff --git
a/op.c
b/op.c
index
1064aff
..
f5a274f
100644
(file)
--- a/
op.c
+++ b/
op.c
@@
-925,6
+925,8
@@
S_cop_free(pTHX_ COP* cop)
if (! specialWARN(cop->cop_warnings))
PerlMemShared_free(cop->cop_warnings);
cophh_free(CopHINTHASH_get(cop));
+ if (PL_curcop == cop)
+ PL_curcop = NULL;
}
STATIC void