4 ms·
Also of interest to folks looking at this might be TySan, the recently-merged LLVM Type-Based Aliasing sanitizer: https://clang.llvm.org/docs/TypeSanitizer.htm
by gavinray 1y ago
Also of interest to folks looking at this might be TySan, the recently-merged LLVM Type-Based Aliasing sanitizer:
https://clang.llvm.org/docs/TypeSanitizer.html https://clang.llvm.org/docs/TypeSanitizer.html
https://www.phoronix.com/news/LLVM-Merge-TySan-Type-Sanitizer https://www.phoronix.com/news/LLVM-Merge-TySan-Type-Sanitize...
- aengelke 1y agoIt's probably worth noting that TySan currently only catches aliasing violations that LLVM would be able to exploit. For some types, e.g. unions, Clang doesn't emit accurate type-based aliasing information and therefore TySan won't catch these.
- flohofwoe 1y agoWhich is fine I think, considering that union type punning is legal in C (and even in C++ where union type punning is UB I have never seen it break - theoretically it might of course).
- uecker 1y agoThe problem might be that Clang does not even implement type-based aliasing correctly. So I assume it checks its broken rules, instead of the one specified in the C standard.