-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runtime safety for branching on undefined values and other undefined behavior caused by undefined values #63
Comments
LLVM has a MemorySanitizer that can detect uninitialized reads with supposedly only 2-3x slowdown compared to 20-30x under valgrind. It has quite a few limitations however: https://clang.llvm.org/docs/MemorySanitizer.html There's a paper on the implementation titled "MemorySanitizer: fast detector of uninitialized memory use in C++" which looks to be valuable reading for anyone looking into this kind of runtime safety check for zig: https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43308.pdf |
Additional drawback as mentioned in #2301 (comment): With this approach for checking UUM => 2.5x compiletime cost, 2x memory. However, this approach still includes false negatives (there can be UUM even though the check says there is none). |
expected output: the runtime calls
@panic("branch on undefined value")
The text was updated successfully, but these errors were encountered: