[perl #87708] $tied == $tied
authorFather Chrysostomos <sprout@cpan.org>
Thu, 7 Apr 2011 18:44:15 +0000 (11:44 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 7 Apr 2011 19:11:33 +0000 (12:11 -0700)
commit7d779b236fc2cb0c2dbe324bda777c76494a71a5
treeb266452ad87b1699b90ab70c684eb59afdbf4ded
parenta778d1f5c1a446254887ec8addb0044ba74ea05a
[perl #87708] $tied == $tied

This is only part of #87708.

This fixes the + operator outside of any â€˜use integer’ scope when the
same tied scalar is used for both operands and returns two different
values. Before this commit, get-magic would be called only once and
the same value used. In 5.12.x it just worked.

I tried modifying pp_eq throughout to take this case into account,
but it made the most common cases slightly slower, presumably because
of the extra checks. So this follows the same temp sv method that I
used for pp_add (in 4c3ac4b and 837c879), which, though slowing down
this edge cases due to the extra allocation, leaves the most common
cases just as fast. (And, in case my benchmarks were unreliably [not
unlikely], this method is also safer, as it has less chance of getting
different code paths wrong.)
pp_hot.c
t/lib/warnings/9uninit
t/op/tie_fetch_count.t