Branch: refs/heads/yves/fix_double_fetch
  Home:   https://github.com/Perl/perl5
  Commit: 8cadae99127b12957578a5e98a6c4272719d4c14
      
https://github.com/Perl/perl5/commit/8cadae99127b12957578a5e98a6c4272719d4c14
  Author: Yves Orton <demer...@gmail.com>
  Date:   2022-12-03 (Sat, 03 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