core icon indicating copy to clipboard operation
core copied to clipboard

Unsigned division overflow is UB

Open lynzrand opened this issue 8 months ago • 0 comments

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

lynzrand avatar May 07 '25 03:05 lynzrand