core
core copied to clipboard
Unsigned division overflow is UB
Native: https://github.com/moonbitlang/moon/actions/runs/14874319279/job/41768630097?pr=796#step:23:139 (on aarch64 it's UB, x86_64 triggers processor exception and kills with SIGFPE or equivalent)
WASM: https://github.com/WebAssembly/design/issues/1390 (Traps)
We should probably skip the test below. Changes in the compiler to panic (instead of relying on platform-specific behavior) in debug mode when meeting integer division overflow might be a good thing to add.
https://github.com/moonbitlang/core/blob/0ffc80102c479dcfaadda0cb55361a6ca45fb764/int16/int16_test.mbt#L154
cc @Young-Flash @Guest0x0