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.
* masked by overloading.pm */
STRLEN len;
const int offset = method / 8;
- const int bit = method % 7;
+ const int bit = method % 8;
char *pv = SvPV(lex_mask, len);
/* Bit set, so this overloading operator is disabled */
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 }
@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
}