llvm-project
4f42e165 - [hwasan] Omit tag check for null pointers (#122206)

Commit
335 days ago
[hwasan] Omit tag check for null pointers (#122206) If the pointer to be checked is statically known to be zero, the tag check will always pass since: 1) the tag is zero 2) shadow memory for address 0 is initialized to 0 and never updated. We can therefore elide the tag check. We perform the elision in two places: 1) the HWASan pass 2) when lowering the CHECK_MEMACCESS intrinsic. Conceivably, the HWASan pass may encounter a "cannot currently statically prove to be null" pointer (and is therefore unable to omit the intrinsic) that later optimization passes convert into a statically known-null pointer. As a last line of defense, we perform elision here too. This also updates the tests from https://github.com/llvm/llvm-project/pull/122186
Author
Parents
Loading