Branch: refs/heads/blead
Home: https://github.com/Perl/perl5
Commit: 6c49e009ca22dd64f00d6d73e89a1ba82e275db5
https://github.com/Perl/perl5/commit/6c49e009ca22dd64f00d6d73e89a1ba82e275db5
Author: Richard Leach <[email protected]>
Date: 2026-01-30 (Fri, 30 Jan 2026)
Changed paths:
M t/lib/croak/toke
M toke.c
Log Message:
-----------
Perl_yyerror_pvn - don't try to add a negative number of chars to msg
`Perl_yyerror_pvn` attempts to identify a `context` - part of the parse
buffer near to where the error was found - and concatenate that to the
existing error message to help the end user narrow down the cause.
However, sometimes the length (`contlen`) of that `context` is calculated
to be negative, which trips an assertion in `Perl_sv_vcatpvfn_flags` when
building the error message.
This was the cause of the assertion failure in GH#16945.
This commit adds a check on the `contlen` when a `context` is present, prior
to calling `Perl_sv_vcatpvfn_flags`.
To unsubscribe from these emails, change your notification settings at
https://github.com/Perl/perl5/settings/notifications