start_shift + (s - strbeg), end_shift, pp, 0);
else
goto fail_finish;
+ /* we may be pointing at the wrong string */
+ if (s && RX_MATCH_COPIED(prog))
+ s = prog->subbeg + (s - SvPVX(sv));
if (data)
*data->scream_olds = s;
}
: (s = fbm_instr((unsigned char*)HOP3(s, back_min, strend),
(unsigned char*)strend, must,
PL_multiline ? FBMrf_MULTILINE : 0))) ) {
+ /* we may be pointing at the wrong string */
+ if ((flags & REXEC_SCREAM) && RX_MATCH_COPIED(prog))
+ s = prog->subbeg + (s - SvPVX(sv));
DEBUG_r( did_match = 1 );
if (HOPc(s, -back_max) > last1) {
last1 = HOPc(s, -back_min);
end_shift, &scream_pos, 1); /* last one */
if (!last)
last = scream_olds; /* Only one occurrence. */
+ /* we may be pointing at the wrong string */
+ else if (RX_MATCH_COPIED(prog))
+ s = prog->subbeg + (s - SvPVX(sv));
}
else {
STRLEN len;
}
require './test.pl';
-plan( tests => 125 );
+plan( tests => 126 );
$x = 'foo';
$_ = "x";
is($_, "\n", "[perl #19048]");
}
-
-
+# [perl #17757] interaction between saw_ampersand and study
+{
+ my $f = eval q{ $& };
+ $f = "xx";
+ study $f;
+ $f =~ s/x/y/g;
+ is($f, "yy", "[perl #17757]");
+}