Problem
Dividing the minimum 64-bit integer by -1 aborts the interpreter:
fn main() {
let x = -9223372036854775807 - 1
print(x / -1)
}home run stops with panic: integer overflow in applyArithmetic. ~/, /! and /? abort the same way. Their neighbours already handle overflow: x - 1 and x * -1 return a runtime error, x +! -1 prints "Integer overflow in checked addition" and returns a runtime error, and x +? -1 returns None. The division cases only check for a zero divisor and then call @divTrunc, which panics on this one overflowing input.
Fix
All four use std.math.divTrunc and handle its overflow error the way their neighbours do: / and ~/ return a runtime error, /! prints "Integer overflow in checked division" and returns a runtime error, and /? returns None. Other quotients are unchanged.
Tests
New eval: dividing the minimum integer by -1 reports the overflow in packages/interpreter/tests/program_eval_test.zig covers all four operators and two ordinary quotients of the same value. On main it crashes the test runner with panic: integer overflow; with this change it passes. Reverting any one of the four call sites makes it crash again at that operator. zig build test -Denable_jsc=false -Dfilter=interpreter on macOS: 24/24. On Linux the interpreter test step does not compile on main or on this branch, because the parser's module resolver calls libc access and that test target does not link libc.
GitHub Actions does not run on this repo at the moment, so I ran the full suite on Linux x86_64 with the pinned Zig 0.17.0-dev.2163, on main (ff51b18) and on this branch: zig build test --summary all passes 9163/9174 on both, with the same 3 failing tests, 8 skips and 21 failed build steps, and the diagnostic snapshot harness output is identical. With the built home, a program that prints is_none(x /? -1) and then x / -1 panics (exit 134) on main; on this branch it prints true and then reports the runtime error (exit 1).