diff options
author | Vincent Pit <perl@profvince.com> | 2009-01-02 12:01:50 +0100 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2009-01-02 12:05:26 +0100 |
commit | d87d3eede5d67a7d281a1d929949e466e06bc21a (patch) | |
tree | d3b7957bee458c23ec30cf81ad96981e9040399d /lib/overload | |
parent | 83706693c63eb4fe0fd171a88263c83548c89029 (diff) | |
download | perl-d87d3eede5d67a7d281a1d929949e466e06bc21a.tar.gz |
Fix overload index mismatch in overloading logic.
In amagic_call(), the 'method' arg comes the overload enum in overload.h, but is expected to match the bit set from %overloading::numbers::names. It values wrongly start at 1, differing by 1 from the enum indexes. This didn't appear in the tests because 'method' was reduced modulo 7 instead of 8.
Diffstat (limited to 'lib/overload')
-rw-r--r-- | lib/overload/numbers.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/overload/numbers.pm b/lib/overload/numbers.pm index b76875891a..2e9e9ac1d9 100644 --- a/lib/overload/numbers.pm +++ b/lib/overload/numbers.pm @@ -153,7 +153,7 @@ our @enums = qw# DESTROY #; -{ my $i; our %names = map { $_ => ++$i } @names } +{ my $i = 0; our %names = map { $_ => $i++ } @names } -{ my $i; our %enums = map { $_ => ++$i } @enums } +{ my $i = 0; our %enums = map { $_ => $i++ } @enums } |