mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[asan] do not treat inline asm calls as indirect calls
llvm-svn: 220985
This commit is contained in:
parent
06167df4ad
commit
74c6d5287c
@ -1408,12 +1408,14 @@ void AddressSanitizer::InjectCoverageForIndirectCalls(
|
||||
for (auto I : IndirCalls) {
|
||||
IRBuilder<> IRB(I);
|
||||
CallSite CS(I);
|
||||
Value *Callee = CS.getCalledValue();
|
||||
if (dyn_cast<InlineAsm>(Callee)) continue;
|
||||
GlobalVariable *CalleeCache = new GlobalVariable(
|
||||
*F.getParent(), Ty, false, GlobalValue::PrivateLinkage,
|
||||
Constant::getNullValue(Ty), "__asan_gen_callee_cache");
|
||||
CalleeCache->setAlignment(kCacheAlignment);
|
||||
IRB.CreateCall2(AsanCovIndirCallFunction,
|
||||
IRB.CreatePointerCast(CS.getCalledValue(), IntptrTy),
|
||||
IRB.CreatePointerCast(Callee, IntptrTy),
|
||||
IRB.CreatePointerCast(CalleeCache, IntptrTy));
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ entry:
|
||||
%1 = load void (%struct.StructWithVptr*)** %vtable, align 8
|
||||
tail call void %1(%struct.StructWithVptr* %foo)
|
||||
tail call void %1(%struct.StructWithVptr* %foo)
|
||||
tail call void asm sideeffect "", ""()
|
||||
ret void
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user