Merge pull request #6563 from FourteenBrush/patch-6

Win32: ensure `make_*` style bounds traps are handled in test runner `expect_signal`
This commit is contained in:
gingerBill
2026-04-13 14:26:30 +01:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

@@ -134,7 +134,7 @@ This is a dire bug and should be reported to the Odin developers.
}
signal := local_test_expected_failures.signal
switch signal {
case libc.SIGILL: passed = code == win32.EXCEPTION_ILLEGAL_INSTRUCTION
case libc.SIGILL: passed = code == win32.EXCEPTION_ILLEGAL_INSTRUCTION || code == win32.EXCEPTION_ARRAY_BOUNDS_EXCEEDED
case libc.SIGSEGV: passed = code == win32.EXCEPTION_ACCESS_VIOLATION
case libc.SIGFPE:
switch code {

View File

@@ -50,3 +50,9 @@ test_expected_signal :: proc(t: ^testing.T) {
testing.expect_signal(t, libc.SIGILL)
libc.raise(libc.SIGILL)
}
@test
test_array_bounds_trap_signal :: proc(t: ^testing.T) {
testing.expect_signal(t, libc.SIGILL)
_ = make([]u8, -1)
}