From 3f53397f402b67341afe2bcb3a3316606b47d15c 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. --- 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 783878cf1ec0be..16cc283fb5707d 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -401,7 +401,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; }