Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: dd99ef826bf82b08c0174db4443699836b7ddb5b
      
https://github.com/Perl/perl5/commit/dd99ef826bf82b08c0174db4443699836b7ddb5b
  Author: Lukas Mai <lukasmai....@gmail.com>
  Date:   2025-08-18 (Mon, 18 Aug 2025)

  Changed paths:
    M sv.c
    M t/lib/warnings/9uninit

  Log Message:
  -----------
  don't blame $x if reftype($x)/refaddr($x) is undef

When the "Use of uninitialized value" warning tries to find the source
of the problem, it skips over builtin::reftype/builtin::refaddr
operations and blames their arguments:

    $ perl -wE 'my $x = 42; $_ = reftype($x) eq ""'
    Use of uninitialized value $x in string eq at -e line 1.
    $ perl -wE 'my $x = 42; $_ = refaddr($x) eq ""'
    Use of uninitialized value $x in string eq at -e line 1.

This is wrong because $x is clearly defined.

This patch teaches S_find_uninit_var that reftype/refaddr can return
undef even if their arguments are perfectly defined.

Fixes #19273.



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

Reply via email to