diff options
| author | Kostya Serebryany <kcc@google.com> | 2012-07-05 09:07:31 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2012-07-05 09:07:31 +0000 |
| commit | e36ae688035919412d7339dda7e449a3b271e737 (patch) | |
| tree | 05151f1a588e3433d9b28330093de3f0bec27130 /llvm/lib/Transforms | |
| parent | 454e8f9ee8fdf98154d499491ab6de36354267d1 (diff) | |
| download | bcm5719-llvm-e36ae688035919412d7339dda7e449a3b271e737.tar.gz bcm5719-llvm-e36ae688035919412d7339dda7e449a3b271e737.zip | |
[tsan] fix compile-time falilure found while building Chromium with tsan (tsan issue #3). A unit test will follow separately.
llvm-svn: 159736
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index 4c12a9b624c..dc0fa7175d9 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -319,7 +319,12 @@ bool ThreadSanitizer::instrumentLoadOrStore(Instruction *I) { if (Idx < 0) return false; if (IsWrite && isVtableAccess(I)) { + DEBUG(dbgs() << " VPTR : " << *I << "\n"); Value *StoredValue = cast<StoreInst>(I)->getValueOperand(); + // StoredValue does not necessary have a pointer type. + if (isa<IntegerType>(StoredValue->getType())) + StoredValue = IRB.CreateIntToPtr(StoredValue, IRB.getInt8PtrTy()); + // Call TsanVptrUpdate. IRB.CreateCall2(TsanVptrUpdate, IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy()), IRB.CreatePointerCast(StoredValue, IRB.getInt8PtrTy())); |

