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:
Simon Pilgrim 2021-01-04 18:53:43 +00:00
parent 52e448974b
commit 84d5768d97
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}