Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: a1d27354cdc17a77c95d1548cc9939dd6b8e1bb8
      
https://github.com/Perl/perl5/commit/a1d27354cdc17a77c95d1548cc9939dd6b8e1bb8
  Author: Lukas Mai <[email protected]>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M sv.c
    M t/lib/warnings/pp_hot

  Log Message:
  -----------
  improve "uninitialized value" warning for multiconcat

The Perl code '$y = "foo" . length($x)' is compiled to a single
multiconcat op. When the code encounters an 'undef' value, it tries to
determine the source, which in this case must be length($x), propagating
undef from $x. But $y, the target of the assignment, is also one of
multiconcat's children, and was also considered a potential source of
undefs, preventing the right variable from being blamed.

This patch makes the scan for potential sources of undefs skip over
multiconcat's last child (the target) if OPf_STACKED is set.

Fixes #24460.


  Commit: 2cfd97a418952481da0e0c933e071a8c0b9a1359
      
https://github.com/Perl/perl5/commit/2cfd97a418952481da0e0c933e071a8c0b9a1359
  Author: Lukas Mai <[email protected]>
  Date:   2026-07-16 (Thu, 16 Jul 2026)

  Changed paths:
    M sv.c
    M t/lib/warnings/pp_hot

  Log Message:
  -----------
  improve "uninitialized" warnings for append multiconcat

In the append case of multiconcat ($y .= "foo" . $x), the target $y is
an input to the operation, but can be skipped when scanning for undefs
because using .= on an uninitialized variable never triggers warnings.
So if a warning is to be emitted, we can blame some non-target child op.


Compare: https://github.com/Perl/perl5/compare/3657fe2672c8...2cfd97a41895

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to