Hacker News new | ask | show | jobs
by _pmf_ 3218 days ago
> but the sanitizer didn't detect the UB.

Isn't this because the sanitizer works with the instrumented "optimized" code, which does no longer invoke UB? Or is the clang toolchain intelligent enough to not perform UB dependent optimizations when the sanitizer is specified?

1 comments

What would it even mean for compiled, machine language code to invoke UB or not?

UB is mostly a C concept, not a lower-level one. The semantics of assembly language programs are well-defined much more often (the only counterexample I can think of is stuff involving using threading, memory barriers, etc. incorrect)