From: Nicholas Clark Date: Wed, 18 Oct 2006 17:35:06 +0000 (+0000) Subject: panic if we attempt to sv_setsv to or from an already freed SV. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=29f4f0ab0cd22a86a6abeeb9b5de96d9506fd84a;p=p5sagit%2Fp5-mst-13.2.git panic if we attempt to sv_setsv to or from an already freed SV. p4raw-id: //depot/perl@29040 --- diff --git a/sv.c b/sv.c index 52fa64f..8820f2a 100644 --- a/sv.c +++ b/sv.c @@ -3406,9 +3406,18 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) if (sstr == dstr) return; + + if (SvIS_FREED(dstr)) { + Perl_croak(aTHX_ "panic: attempt to copy value %" SVf + " to a freed scalar %p", sstr, dstr); + } SV_CHECK_THINKFIRST_COW_DROP(dstr); if (!sstr) sstr = &PL_sv_undef; + if (SvIS_FREED(sstr)) { + Perl_croak(aTHX_ "panic: attempt to copy freed scalar %p to %p", sstr, + dstr); + } stype = SvTYPE(sstr); dtype = SvTYPE(dstr);