diff options
author | Yves Orton <demerphq@gmail.com> | 2022-12-03 01:37:46 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2022-12-06 14:18:00 +0100 |
commit | 44282561d32a069322c5641afa41adf8fd82b77e (patch) | |
tree | ba482b15b66974f7e0251e07b9fc1bb4a23239bb /pod/perldelta.pod | |
parent | 9a266c095272ba2b07c7d46e33fa7b547628bcce (diff) | |
download | perl-44282561d32a069322c5641afa41adf8fd82b77e.tar.gz |
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.
Diffstat (limited to 'pod/perldelta.pod')
-rw-r--r-- | pod/perldelta.pod | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 79028470c4..47b3cc0641 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -395,6 +395,12 @@ Also, embedded C<NUL> characters are now allowed in the input. If locale collation is not enabled on the platform (C<LC_COLLATE>), the input is returned unchanged. +=item * + +Double FETCH during stringification of tied scalars returning an +overloaded object have been fixed. The FETCH method should only be +called once, but prior to this release was actually called twice. + =back =head1 Known Problems |