mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-25 05:09:53 +00:00
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:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user