mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-25 13:18:14 +00:00
Merge pull request #6570 from blob1807/test-win-oob-exception
[core:test] Windows - Fix stop reason being wrong for OOB
This commit is contained in:
@@ -163,6 +163,7 @@ _setup_signal_handler :: proc() {
|
||||
// For tests:
|
||||
// Catch the following:
|
||||
// - Asserts and panics;
|
||||
// - Out of Bounds exeptions;
|
||||
// - Arithmetic errors; and
|
||||
// - Segmentation faults (illegal memory access).
|
||||
win32.AddVectoredExceptionHandler(0, stop_test_callback)
|
||||
@@ -194,10 +195,11 @@ _should_stop_test :: proc() -> (test_index: int, reason: Stop_Reason, ok: bool)
|
||||
reason = .Successful_Stop
|
||||
} else {
|
||||
switch intrinsics.atomic_load(&stop_test_signal) {
|
||||
case win32.EXCEPTION_ILLEGAL_INSTRUCTION: reason = .Illegal_Instruction
|
||||
case win32.EXCEPTION_ACCESS_VIOLATION: reason = .Segmentation_Fault
|
||||
case win32.EXCEPTION_BREAKPOINT: reason = .Unhandled_Trap
|
||||
case win32.EXCEPTION_SINGLE_STEP: reason = .Unhandled_Trap
|
||||
case win32.EXCEPTION_ARRAY_BOUNDS_EXCEEDED: reason = .Illegal_Instruction
|
||||
case win32.EXCEPTION_ILLEGAL_INSTRUCTION: reason = .Illegal_Instruction
|
||||
case win32.EXCEPTION_ACCESS_VIOLATION: reason = .Segmentation_Fault
|
||||
case win32.EXCEPTION_BREAKPOINT: reason = .Unhandled_Trap
|
||||
case win32.EXCEPTION_SINGLE_STEP: reason = .Unhandled_Trap
|
||||
|
||||
case win32.EXCEPTION_FLT_DENORMAL_OPERAND ..= win32.EXCEPTION_INT_OVERFLOW:
|
||||
reason = .Arithmetic_Error
|
||||
|
||||
Reference in New Issue
Block a user