X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FTransforms%2FInstrumentation%2FAddressSanitizer.cpp;h=e93c011913f88fceff61d12bcedec2f57ab5d8b6;hp=de7b83d02940c91c6dd84797ee4d878ac6011949;hb=854432d7e55a169a46d319cf0edffab790709582;hpb=9b6ca9304cd7deb0598b0c3d7488023bfffd29d9 diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index de7b83d0294..e93c011913f 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1408,12 +1408,14 @@ void AddressSanitizer::InjectCoverageForIndirectCalls( for (auto I : IndirCalls) { IRBuilder<> IRB(I); CallSite CS(I); + Value *Callee = CS.getCalledValue(); + if (dyn_cast(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)); } }