summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorYitzchak Scott-Thoennes <sthoenna@efn.org>2003-03-07 05:12:49 -0800
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-03-10 19:55:06 +0000
commitb77f7d40943072c6b8a82e9e0fbdcc2d346120ee (patch)
tree3d52b1a0ba2b23673c376f14b93f984dd323110a /mg.c
parent9d60fda321e877ece79517ad795f7f4cf63bb3a7 (diff)
downloadperl-b77f7d40943072c6b8a82e9e0fbdcc2d346120ee.tar.gz
Re: odd (or not so odd?) segmentation fault in 5.8.0
Message-ID: <RtQa+gzkg2kF092yn@efn.org> p4raw-id: //depot/perl@18889
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mg.c b/mg.c
index 941338b644..98e4c098d4 100644
--- a/mg.c
+++ b/mg.c
@@ -133,6 +133,12 @@ Perl_mg_get(pTHX_ SV *sv)
if (!(mg->mg_flags & MGf_GSKIP) && vtbl && vtbl->svt_get) {
CALL_FPTR(vtbl->svt_get)(aTHX_ sv, mg);
+
+ /* guard against sv having been freed */
+ if (SvTYPE(sv) == SVTYPEMASK) {
+ Perl_croak(aTHX_ "Tied variable freed while still in use");
+ }
+
/* Don't restore the flags for this entry if it was deleted. */
if (mg->mg_flags & MGf_GSKIP)
(SSPTR(mgs_ix, MGS *))->mgs_flags = 0;