This makes error messages from code like this:
$f = "(?{q\0foo\0 + \x{FFFF}})";
"a" =~ /^a$f/;
Be both UTF-8 and nul clean.
{
Safefree(pRExC_state->code_blocks);
/* use croak_sv ? */
- Perl_croak_nocontext("%s", SvPV_nolen_const(errsv));
+ Perl_croak_nocontext("%"SVf, SVfARG(errsv));
}
}
assert(SvROK(qr_ref));
}
-plan tests => 519; # Update this when adding/deleting tests.
+plan tests => 520; # Update this when adding/deleting tests.
run_tests() unless caller;
like($@,
qr/BEGIN failed--compilation aborted at \(eval \d+\) line \d+/,
'syntax error');
+
+ use utf8;
+ $code = '(?{Foo::$bar})';
+ eval { "a" =~ /^a$code/ };
+ like($@, qr/Bad name after Foo:: at \(eval \d+\) line \d+/, 'UTF8 sytax error');
}
# make sure that 'use re eval' is propagated into compiling the
"...and nul-clean"
);
- TODO: {
- local $::TODO = "Unrecognized character thrown from a re-eval not UTF8/nul clean yet";
-
+ {
use re 'eval';
my $f = qq{(?{\$ネ+ 1; \x{1F42A} })};
eval { "a" =~ /^a$f/ };