[llvm-branch-commits] [HWASAN] Don't instrument loads from global if globals are not tagged (PR #86774)

Florian Mayer via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Mar 27 10:52:29 PDT 2024


================
@@ -790,6 +790,14 @@ bool HWAddressSanitizer::ignoreAccess(Instruction *Inst, Value *Ptr) {
     if (SSI && SSI->stackAccessIsSafe(*Inst))
       return true;
   }
+
+  GlobalVariable *G = dyn_cast<GlobalVariable>(getUnderlyingObject(Ptr));
+  if (G) {
----------------
fmayer wrote:

Maybe `if (GlobalVariable* G = dyn_cast<GlobalVariable>(getUnderlyingObject(Ptr)))`?

https://github.com/llvm/llvm-project/pull/86774


More information about the llvm-branch-commits mailing list