Change 33889 by [EMAIL PROTECTED] on 2008/05/20 17:02:15
Integrate:
[ 33778]
Subject: Re: [perl #51636] segmentation fault with array ties
From: "Vincent Pit" <[EMAIL PROTECTED]>
Date: Wed, 12 Mar 2008 17:37:40 +0100 (CET)
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/maint-5.10/perl/pp_hot.c#12 integrate
Differences ...
==== //depot/maint-5.10/perl/pp_hot.c#12 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#11~33856~ 2008-05-18 09:11:18.000000000 -0700
+++ perl/pp_hot.c 2008-05-20 10:02:15.000000000 -0700
@@ -1033,8 +1033,14 @@
*(relem++) = sv;
didstore = av_store(ary,i++,sv);
if (magic) {
- if (SvSMAGICAL(sv))
+ if (SvSMAGICAL(sv)) {
+ /* More magic can happen in the mg_set callback, so we
+ * backup the delaymagic for now. */
+ U16 dmbak = PL_delaymagic;
+ PL_delaymagic = 0;
mg_set(sv);
+ PL_delaymagic = dmbak;
+ }
if (!didstore)
sv_2mortal(sv);
}
@@ -1064,8 +1070,12 @@
duplicates += 2;
didstore = hv_store_ent(hash,sv,tmpstr,0);
if (magic) {
- if (SvSMAGICAL(tmpstr))
+ if (SvSMAGICAL(tmpstr)) {
+ U16 dmbak = PL_delaymagic;
+ PL_delaymagic = 0;
mg_set(tmpstr);
+ PL_delaymagic = dmbak;
+ }
if (!didstore)
sv_2mortal(tmpstr);
}
@@ -1089,7 +1099,13 @@
}
else
sv_setsv(sv, &PL_sv_undef);
- SvSETMAGIC(sv);
+
+ if (SvSMAGICAL(sv)) {
+ U16 dmbak = PL_delaymagic;
+ PL_delaymagic = 0;
+ mg_set(sv);
+ PL_delaymagic = dmbak;
+ }
break;
}
}
End of Patch.