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
fix: emit bxor, not bnot, for binary '~' at gen-target 5.1 (#1168)
The '~' token is both unary bitwise NOT and binary bitwise XOR, and the
5.1 compat pass matched on the operator token alone. Binary '~' was
rewritten to bit32.bnot(a), dropping the right operand and changing the
operation; a __bxor metamethod call was dispatched to __bnot. Check the
arity so binary '~' falls through to the existing bit_operators branch.
spec/util.lua built its line arrays with gmatch("([^\n]*)\n"), which
drops the final line, so a util.gen mismatch confined to the last line
of generated output was never reported. That hid the metamethod half of
this bug from the new test and from the existing __bnot metamethod test.
Co-authored-by: Dylan Pulver <dylanpulver@users.noreply.github.com>
0 commit comments