like $@, qr/^Invalid CODE attributes: ["']?plugh\(0,0\)["']? /;
eval 'sub e3 ($) : plugh(0,0 xyzzy ;';
-like $@, qr/Unterminated attribute parameter in attribute list at/;
+like $@, qr/^Unterminated attribute parameter in attribute list at \(eval \d+\) line 1\.$/;
eval 'sub e4 ($) : plugh + XYZZY ;';
like $@, qr/Invalid separator character '[+]' in attribute list at/;
eval 'my $x : locked method;';
like $@, qr/^Invalid SCALAR attributes: ["']?locked : method["']? at/;
eval 'my $x : switch(10,foo();';
-like $@, qr/^Unterminated attribute parameter in attribute list at/;
+like $@, qr/^Unterminated attribute parameter in attribute list at \(eval \d+\) line 1\.$/;
eval q/my $x : Ugly('(');/;
-like $@, qr/^Unterminated attribute parameter in attribute list at/;
+like $@, qr/^Unterminated attribute parameter in attribute list at \(eval \d+\) line 1\.$/;
eval 'my $x : 5x5;';
like $@, qr/error/;
eval 'my $x : Y2::north;';
"OK",
'RT #129099 BEGIN()';
+
+#129086
+# When printing error message for an attribute arg without closing ')',
+# if the buffer got reallocated during the scan of the arg, the error
+# message would try to use the old buffer
+fresh_perl_like(
+ 'my $abc: abcdefg(' . 'x' x 195 . "\n" . 'x' x 8200 ."\n",
+ qr/^Unterminated attribute parameter in attribute list at - line 1\.$/,
+ { stderr => 1 },
+ 'RT #129086 attr(00000'
+),
+
done_testing();
sv = newSVpvn_flags(s, len, UTF ? SVf_UTF8 : 0);
if (*d == '(') {
d = scan_str(d,TRUE,TRUE,FALSE,NULL);
- COPLINE_SET_FROM_MULTI_END;
if (!d) {
- /* MUST advance bufptr here to avoid bogus
- "at end of line" context messages from yyerror().
- */
- PL_bufptr = s + len;
- yyerror("Unterminated attribute parameter in attribute list");
if (attrs)
op_free(attrs);
sv_free(sv);
- return REPORT(0); /* EOF indicator */
+ Perl_croak(aTHX_ "Unterminated attribute parameter in attribute list");
}
+ COPLINE_SET_FROM_MULTI_END;
}
if (PL_lex_stuff) {
sv_catsv(sv, PL_lex_stuff);