summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-28 12:39:04 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-29 09:11:30 -0800
commit959f7ad7c12f768f896b4dd48b5b7f41b6b087b5 (patch)
tree6ffcb8d8cbd464f1c3c4c438c0c47c3c48e37022 /scope.c
parent978a498e17ec54b6f1fc65f3375a62a68f321f99 (diff)
downloadperl-959f7ad7c12f768f896b4dd48b5b7f41b6b087b5.tar.gz
Don’t croak for local *DetachedStash::method
save_gp was trying to call mro_method_changed_in even if the stash had been detached. This is a regression from 5.12.
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scope.c b/scope.c
index 8eca725f22..c4a2222e75 100644
--- a/scope.c
+++ b/scope.c
@@ -285,8 +285,9 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty)
if (empty) {
GP *gp = Perl_newGP(aTHX_ gv);
+ HV * const stash = GvSTASH(gv);
- if (GvCVu(gv))
+ if (GvCVu(gv) && stash && HvENAME(stash))
mro_method_changed_in(GvSTASH(gv)); /* taking a method out of circulation ("local")*/
if (GvIOp(gv) && (IoFLAGS(GvIOp(gv)) & IOf_ARGV)) {
gp->gp_io = newIO();