-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorstage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.
Milestone
Description
I'm building using zig 0.4.0+fcc0728 on 64 bit Windows 10, built from source in Release mode.
The following file run through zig test causes Zig to exit with no output and only empty files written to the zig-cache:
fn crash() !void {
return error.Crash;
}
test "A problem happens" {
inline for ([_]u8{ 0, 1 }) |x| {
if (crash()) {} else |z| {
return;
}
}
}The exit code, according to an echo %errorlevel%, is -1073741819. The Windows Event Viewer has the following log:
Exception code: 0xc0000005
Fault offset: 0x0000000001d20690
Faulting process id: 0xac8
The test input is seemingly minimal. It doesn't crash with only one/zero elements, it doesn't crash if the return is removed, replaced with other code, or moved to the other branch (though break also causes it). It doesn't crash with a regular if/else. It doesn't crash if replaced with try or with catch.
TheZeus121
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorstage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.