Adrian M. Enache [Mon, 8 Dec 2003 03:38:39 +0000 (03:38 +0000)]
#!perl
eval q{ $_ = "x"; s/x/"in subst"/e } while 1;
__END__
p4raw-id: //depot/perl@21868
char *orig = cx->sb_orig;
register REGEXP *rx = cx->sb_rx;
SV *nsv = Nullsv;
-
- {
- REGEXP *old = PM_GETRE(pm);
- if(old != rx) {
+ REGEXP *old = PM_GETRE(pm);
+ if(old != rx) {
if(old)
- ReREFCNT_dec(old);
+ ReREFCNT_dec(old);
PM_SETRE(pm,rx);
- }
}
rxres_restore(&cx->sb_rxres, rx);
sv_pos_b2u(sv, &i);
mg->mg_len = i;
}
- ReREFCNT_inc(rx);
+ if (old != rx)
+ ReREFCNT_inc(rx);
cx->sb_rxtainted |= RX_MATCH_TAINTED(rx);
rxres_save(&cx->sb_rxres, rx);
RETURNOP(pm->op_pmreplstart);