summaryrefslogtreecommitdiff
path: root/overload.pl
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2009-01-02 12:01:50 +0100
committerVincent Pit <perl@profvince.com>2009-01-02 12:05:26 +0100
commitd87d3eede5d67a7d281a1d929949e466e06bc21a (patch)
treed3b7957bee458c23ec30cf81ad96981e9040399d /overload.pl
parent83706693c63eb4fe0fd171a88263c83548c89029 (diff)
downloadperl-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 'overload.pl')
-rw-r--r--overload.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/overload.pl b/overload.pl
index 01dd550e4e..6f0fe34ffd 100644
--- a/overload.pl
+++ b/overload.pl
@@ -58,9 +58,9 @@ our \@enums = qw#
@enums
#;
-{ 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 }
EOF
}