mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 21:32:39 +00:00
[tsan] fix compile-time falilure found while building Chromium with tsan (tsan issue #3). A unit test will follow separately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159736 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7a7a6db6d7
commit
4a002ab9c3
@ -319,7 +319,12 @@ bool ThreadSanitizer::instrumentLoadOrStore(Instruction *I) {
|
|||||||
if (Idx < 0)
|
if (Idx < 0)
|
||||||
return false;
|
return false;
|
||||||
if (IsWrite && isVtableAccess(I)) {
|
if (IsWrite && isVtableAccess(I)) {
|
||||||
|
DEBUG(dbgs() << " VPTR : " << *I << "\n");
|
||||||
Value *StoredValue = cast<StoreInst>(I)->getValueOperand();
|
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.CreateCall2(TsanVptrUpdate,
|
||||||
IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy()),
|
IRB.CreatePointerCast(Addr, IRB.getInt8PtrTy()),
|
||||||
IRB.CreatePointerCast(StoredValue, IRB.getInt8PtrTy()));
|
IRB.CreatePointerCast(StoredValue, IRB.getInt8PtrTy()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user