You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bc: route bitwise BC fast paths through mino_int_wrap
Surfaced by mino-tests's gen.clj while building a seeded xorshift64*
RNG: a few iterations of (bit-xor x (bit-shift-left x1 25)) inside
a defn body raised MTY001 "bit-xor expects integers". Same code at
top level worked.
binop_int_fast in src/eval/bc/vm.c routed BAND / BOR / BXOR / SHL /
SHR / USHR results through tag_or_box_int, which falls back to
mino_int that promotes to MINO_BIGINT when bignum capability is
installed. The corresponding prims use mino_int_wrap which always
boxes as MINO_INT and never promotes. The two paths produced
different result types; a downstream bit-xor's fast-path check
refused the bigint -- hence the misleading MTY001.
Fix routes all bitwise BC fast paths through mino_int_wrap. ADD /
SUB / MUL keep tag_or_box_int since Clojure-correct overflow there
DOES promote to bigint.
Regression test in tests/bc_bitwise_test.clj: five bitwise ops at
i64 range plus the xorshift64* chain that surfaced the issue.
Suite: 1272 / 4549 green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments