Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 44282561d32a069322c5641afa41adf8fd82b77e
      
https://github.com/Perl/perl5/commit/44282561d32a069322c5641afa41adf8fd82b77e
  Author: Yves Orton <demer...@gmail.com>
  Date:   2022-12-06 (Tue, 06 Dec 2022)

  Changed paths:
    M lib/overload.t
    M pod/perldelta.pod
    M sv.c

  Log Message:
  -----------
  sv.c - sv_2pv_flags: Fix double FETCH from tied overloaded scalar

When dealing with a tied scalar with get magic, and the FETCH method
returned a blessed reference with overloading magic (with "a" magic),
the tied scalar returned from the fetch was not copied prior to calling
the magic function as an argument, this would then cause the get magic
to be called again if the overloaded method happened to copy or
otherwise use the tied scalar. The solution is to copy the reference
prior to dispatching the overload call.

It looks like we have been testing for the double FETCH for some time,
without any good rationale, so this test merely changes things to expect
the desired count.


Reply via email to