Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > perl.perl5.changes > #34316

[Perl/perl5] 6c49e0: Perl_yyerror_pvn - don't try to add a negative num...

Newsgroups perl.perl5.changes
Date 2026-01-30 14:29 -0800
Message-ID <Perl/perl5/push/refs/heads/blead/da0069-6c49e0@github.com> (permalink)
Subject [Perl/perl5] 6c49e0: Perl_yyerror_pvn - don't try to add a negative num...
From perl5-changes@perl.org (Richard Leach via perl5-changes)

Show all headers | View raw


  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 6c49e009ca22dd64f00d6d73e89a1ba82e275db5
      https://github.com/Perl/perl5/commit/6c49e009ca22dd64f00d6d73e89a1ba82e275db5
  Author: Richard Leach <richardleach@users.noreply.github.com>
  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

Back to perl.perl5.changes | Previous | Next | Find similar | Unroll thread


Thread

[Perl/perl5] 6c49e0: Perl_yyerror_pvn - don't try to add a negative num... perl5-changes@perl.org (Richard Leach via perl5-changes) - 2026-01-30 14:29 -0800

csiph-web