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

[Perl/perl5] b571f3: pp.c - forbid localizing and aliasing readonlyhas...

From:
Yves Orton via perl5-changes
Date:
March 25, 2023 19:33
Subject:
[Perl/perl5] b571f3: pp.c - forbid localizing and aliasing readonlyhas...
Message ID:
Perl/perl5/push/refs/heads/yves/restricted_hash_disallow_alias_or_local/c17464-b571f3@github.com
  Branch: refs/heads/yves/restricted_hash_disallow_alias_or_local
  Home:   https://github.com/Perl/perl5
  Commit: b571f323d1720029a816732ac03b399f075e4452
      https://github.com/Perl/perl5/commit/b571f323d1720029a816732ac03b399f075e4452
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2023-03-25 (Sat, 25 Mar 2023)

  Changed paths:
    M embed.fnc
    M hv.c
    M hv.h
    M pod/perldiag.pod
    M pp.c
    M pp_hot.c
    M proto.h
    M t/op/lvref.t

  Log Message:
  -----------
  pp.c - forbid localizing and aliasing readonly hash keys in restricted hashes

local $hash{key} and \$hash{key} = \$var are both conceptually modify
operations which are forbidden when the hash is restricted and the value
is readonly. Unfortunately prior to this commit they were still allowed
operations. This patch corrects that oversight.

Adds a bunch of tests to t/op/lvref.t to ensure that it is illegal to
localize or ref-alias a readonly value in a restricted hash.





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