2013-06-06 15:35:18 +02:00
|
|
|
--- ./regcomp.c.orig 2013-06-06 13:04:19.000000000 +0000
|
|
|
|
+++ ./regcomp.c 2013-06-06 13:15:51.000000000 +0000
|
|
|
|
@@ -15461,8 +15461,21 @@ Perl_save_re_context(pTHX)
|
2011-05-16 16:18:55 +02:00
|
|
|
|
|
|
|
if (gvp) {
|
|
|
|
GV * const gv = *gvp;
|
|
|
|
- if (SvTYPE(gv) == SVt_PVGV && GvSV(gv))
|
|
|
|
- save_scalar(gv);
|
|
|
|
+ if (SvTYPE(gv) == SVt_PVGV && GvSV(gv)) {
|
|
|
|
+ /* this is a copy of save_scalar() without the GETMAGIC call, RT#76538 */
|
|
|
|
+ SV ** const sptr = &GvSVn(gv);
|
|
|
|
+ SV * osv = *sptr;
|
|
|
|
+ SV * nsv = newSV(0);
|
|
|
|
+ save_pushptrptr(SvREFCNT_inc_simple(gv), SvREFCNT_inc(osv), SAVEt_SV);
|
2013-06-06 15:35:18 +02:00
|
|
|
+ if (SvTYPE(osv) >= SVt_PVMG && SvMAGIC(osv)) {
|
2011-05-16 16:18:55 +02:00
|
|
|
+ if (SvGMAGICAL(osv)) {
|
|
|
|
+ SvFLAGS(osv) |= (SvFLAGS(osv) &
|
|
|
|
+ (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
|
|
|
|
+ }
|
2013-06-06 15:35:18 +02:00
|
|
|
+ mg_localize(osv, nsv, (bool)1);
|
2011-05-16 16:18:55 +02:00
|
|
|
+ }
|
|
|
|
+ *sptr = nsv;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|