forked from OSchip/llvm-project
MemProfiler::insertDynamicShadowAtFunctionEntry - use cast<> instead of dyn_cast<> for dereferenced pointer. NFCI.
We're immediately dereferencing the casted pointer, so use cast<> which will assert instead of dyn_cast<> which can return null. Fixes static analyzer warning.
This commit is contained in:
parent
52e448974b
commit
84d5768d97
|
@ -577,7 +577,7 @@ bool MemProfiler::insertDynamicShadowAtFunctionEntry(Function &F) {
|
|||
Value *GlobalDynamicAddress = F.getParent()->getOrInsertGlobal(
|
||||
MemProfShadowMemoryDynamicAddress, IntptrTy);
|
||||
if (F.getParent()->getPICLevel() == PICLevel::NotPIC)
|
||||
dyn_cast<GlobalVariable>(GlobalDynamicAddress)->setDSOLocal(true);
|
||||
cast<GlobalVariable>(GlobalDynamicAddress)->setDSOLocal(true);
|
||||
DynamicShadowOffset = IRB.CreateLoad(IntptrTy, GlobalDynamicAddress);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue