Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In newXS, clear glob slot before lowering refcount.
Otherwise, when newXS redefines a sub, the previous sub’s DESTROY can see the same sub still in the typeglob, but without a reference count, so *typeglob = sub {} frees the sub currently in $_[0]. $ perl5.18.1 -le ' sub re::regmust{} bless \&re::regmust; DESTROY { print "before: $_[0]"; *re::regmust=sub{}; print "after: $_[0]" } require re; ' before: main=CODE(0x7ff7eb02d6d8) before: main=CODE(0x7ff7eb02d6d8) after: main=CODE(0x7ff7eb02d6d8) after: UNKNOWN(0x7ff7eb02d6d8)
- Loading branch information
Father Chrysostomos
committed
Nov 12, 2013
1 parent
4571f4a
commit 7004ee4
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters