develooper Front page | perl.perl5.changes | Postings from March 2023

[Perl/perl5] 095fd9: report uninit variable name even in optimizedcases

From:
mauke via perl5-changes
Date:
March 23, 2023 23:56
Subject:
[Perl/perl5] 095fd9: report uninit variable name even in optimizedcases
Message ID:
Perl/perl5/push/refs/heads/blead/fe937a-095fd9@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 095fd90e6ff7791c309ef4175edebb2295e5ea04
      https://github.com/Perl/perl5/commit/095fd90e6ff7791c309ef4175edebb2295e5ea04
  Author: Lukas Mai <lukasmai.403@gmail.com>
  Date:   2023-03-24 (Fri, 24 Mar 2023)

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

  Log Message:
  -----------
  report uninit variable name even in optimized cases

Several cases that used to be simple assignment ops with lexical
variables have been optimized in some way:

 - $foo = undef is now a single OP_UNDEF with special flags
 - $foo = ... is now a single OP_PADSV_STORE
 - $foo[0] = ... is now a single OP_AELEMFASTLEX_STORE

This is mostly transparent to users, except for "Use of uninitialized
value" warnings, which previously mentioned the name of the undefined
variable, but don't do so anymore in blead.

This commit teaches find_uninit_var() about the new ops, so error
messages for these ops can mention variable names again.

Fixes #20945.





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About