You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code above should assert in the case of other_broken_int (or at least cause an OS exception), however in the case of a debug build or a test on Windows it actually works just fine.
From the behavior, I would guess that Zig is using some Windows Structure Exception Handling in debug builds to catch things like Divide By Zero, and the filters weren't set correctly causing the exception that should be thrown here to be caught and ignored, allowing execution to continue.
However, I can't seem to find any SEH related symbols being referenced in the executable, so I'm at a loss.
The text was updated successfully, but these errors were encountered:
This is probably just down to differing stack behavior between OSs and struct size between build modes. Sometimes I get "lucky" and the stack data is still there, other times I run into a stack protector or something. For whatever reason, in this simple test case, my expectation of the stack behavior aligned with reality in the majority of cases.
Unfortunately this means that this particular safety pattern isn't very helpful.
The code above should assert in the case of other_broken_int (or at least cause an OS exception), however in the case of a debug build or a test on Windows it actually works just fine.
From the behavior, I would guess that Zig is using some Windows Structure Exception Handling in debug builds to catch things like Divide By Zero, and the filters weren't set correctly causing the exception that should be thrown here to be caught and ignored, allowing execution to continue.
However, I can't seem to find any SEH related symbols being referenced in the executable, so I'm at a loss.
The text was updated successfully, but these errors were encountered: