Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 5f5946e91cdf0dec287e96e997baa0a1 > files > 4

perl-5.12.3-4.2.mga1.src.rpm

reverting http://public.activestate.com/cgi-bin/perlbrowse/p/29040 :

# Change 29040 by nicholas@ballet-shoe on 2006/10/18 17:35:06
# 
# 	panic if we attempt to sv_setsv to or from an already freed SV.
# 
# Affected files ...
# 
# ... //depot/perl/sv.c#1309 edit

to help on bug mdvbz#34505 together with perl-5.10.0-workaround-segfault-freeing-scalar-a-second-time.patch

cf http://rt.perl.org/rt3/Public/Bug/Display.html?id=50142 which shows the code can still "work" without panicking

diff -p -up perl-5.10.0/sv.c.pix perl-5.10.0/sv.c
--- perl-5.10.0/sv.c.pix	2008-04-01 18:19:19.000000000 +0200
+++ perl-5.10.0/sv.c	2008-04-01 18:20:18.000000000 +0200
@@ -3371,18 +3371,9 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, regi
 
     if (sstr == dstr)
 	return;
-
-    if (SvIS_FREED(dstr)) {
-	Perl_croak(aTHX_ "panic: attempt to copy value %" SVf
-		   " to a freed scalar %p", SVfARG(sstr), (void *)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",
-		   (void*)sstr, (void*)dstr);
-    }
     stype = SvTYPE(sstr);
     dtype = SvTYPE(dstr);