}
else {
maxiters += slen * rx->nparens;
- while (s < strend && --limit
-/* && (!rx->check_substr
- || ((s = CALLREG_INTUIT_START(aTHX_ rx, sv, s, strend,
- 0, NULL))))
-*/ && CALLREGEXEC(aTHX_ rx, s, strend, orig,
- 1 /* minend */, sv, NULL, 0))
+ while (s < strend && --limit)
{
+ PUTBACK;
+ i = CALLREGEXEC(aTHX_ rx, s, strend, orig, 1 , sv, NULL, 0);
+ SPAGAIN;
+ if (i == 0)
+ break;
TAINT_IF(RX_MATCH_TAINTED(rx));
if (RX_MATCH_COPIED(rx) && rx->subbeg != orig) {
m = s;
}
}
s = rx->endp[0] + orig;
- PUTBACK;
}
}
COP *ocurcop = PL_curcop;
PAD *old_comppad;
SV *ret;
+ struct regexp *oreg = PL_reg_re;
n = ARG(scan);
PL_op = (OP_4tree*)PL_regdata->data[n];
sw = SvTRUE(ret);
logical = 0;
}
- else
+ else {
sv_setsv(save_scalar(PL_replgv), ret);
+ cache_re(oreg);
+ }
break;
}
case OPEN:
$| = 1;
-print "1..1004\n";
+print "1..1006\n";
BEGIN {
chdir 't' if -d 't';
{
my $i;
ok('-1-3-5-' eq join('', split /((??{$i++}))/, '-1-3-5-'),
- "[perl #21411] (??{ .. }) corrupts split's stack")
+ "[perl #21411] (??{ .. }) corrupts split's stack");
+ split /(?{'WOW'})/, 'abc';
+ ok('a|b|c' eq join ('|', @_),
+ "[perl #21411] (?{ .. }) version of the above");
+}
+
+{
+ split /(?{ split "" })/, "abc";
+ ok(1,'cache_re & "(?{": it dumps core in 5.6.1 & 5.8.0');
}
{