From 58df73b7d510d59462d56092595cf9c91404c601 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Sat, 19 May 2018 11:56:55 -0400 Subject: [PATCH] Allow for custom address spaces Julia uses addressspaces for GC and we want these to be sanitized as well. (cherry picked from commit 3f53397f402b67341afe2bcb3a3316606b47d15c) --- llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index 063999a682367b..60fa777668b55d 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -431,7 +431,9 @@ static bool shouldInstrumentReadWriteFromAddress(const Module *M, Value *Addr) { // with them. if (Addr) { Type *PtrTy = cast(Addr->getType()->getScalarType()); - if (PtrTy->getPointerAddressSpace() != 0) + auto AS = PtrTy->getPointerAddressSpace(); + // Allow for custom addresspaces + if (AS != 0 && AS < 10) return false; }