[llvm] [TySan] A Type Sanitizer (LLVM) (PR #76259)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 22 11:44:34 PST 2023


================
@@ -371,11 +371,27 @@ static bool isStructPathTBAA(const MDNode *MD) {
   return isa<MDNode>(MD->getOperand(0)) && MD->getNumOperands() >= 3;
 }
 
+// When using the TypeSanitizer, don't use TBAA information for alias analysis.
+// This might cause us to remove memory accesses that we need to verify at
+// runtime.
+static bool usingSanitizeType(const Value *V) {
----------------
nikic wrote:

TypeBasedAAResult is constructed on a per-function basis, so you should cache this in run(). Has the nice side benefit that Function is available at that point and you don't have to guess it from the accessed value, which will be unreliable (e.g. for accesses to globals).

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


More information about the llvm-commits mailing list