develooper Front page | perl.perl5.changes | Postings from September 2021

[Perl/perl5] 24b5b9: Test the interaction of of tie/untie and hashiter...

From:
Nicholas Clark via perl5-changes
Date:
September 22, 2021 06:49
Subject:
[Perl/perl5] 24b5b9: Test the interaction of of tie/untie and hashiter...
Message ID:
Perl/perl5/push/refs/heads/blead/644e3e-71e218@github.com
  Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 24b5b9e1bfb4ecdbe8ba39fada3fc76d9648e584
      https://github.com/Perl/perl5/commit/24b5b9e1bfb4ecdbe8ba39fada3fc76d9648e584
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-09-22 (Wed, 22 Sep 2021)

  Changed paths:
    M t/op/tiehash.t

  Log Message:
  -----------
  Test the interaction of of tie/untie and hash iterators

This is not intended as a test of *correctness*. This behaviour is
observable by code on CPAN, so potentially some of it will inadvertently be
relying on it (and likely not in any regression test). Hence this "test"
here is intended as a way to alert us if any core code change has the side
effect of alerting this observable behaviour.


  Commit: 2536d892ffab416d2d30b44e4d64f0491177bf85
      https://github.com/Perl/perl5/commit/2536d892ffab416d2d30b44e4d64f0491177bf85
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-09-22 (Wed, 22 Sep 2021)

  Changed paths:
    M t/op/tie.t

  Log Message:
  -----------
  A test for the order of untie/iterator state interaction

This is not intended as a test of *correctness*. The precise ordering of all
the events here is observable by code on CPAN, so potentially some of it
will inadvertently be relying on it (and likely not in any regression test).
Hence this "test" here is intended as a way to alert us if any core code
change has the side effect of altering this observable behaviour, so that we
can document it in the perldelta.


  Commit: 71e2181fdc1da7dfd599d69d45e604c493276c68
      https://github.com/Perl/perl5/commit/71e2181fdc1da7dfd599d69d45e604c493276c68
  Author: Nicholas Clark <nick@ccl4.org>
  Date:   2021-09-22 (Wed, 22 Sep 2021)

  Changed paths:
    M pod/perldelta.pod
    M pp_sys.c
    M t/op/tie.t

  Log Message:
  -----------
  Free tied hash iterator state immediately at the `untie` call

Previously the state was only freed at the point when the hash was iterated
again, or re-tied, or destroyed.

This shouldn't make any difference to sane code, but the change can be
detected with suitably pathological pure-Perl code, so someone might just
(unwisely) be relying on this undocumented implementation detail.


Compare: https://github.com/Perl/perl5/compare/644e3ee3290a...71e2181fdc1d



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