Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jumormt committed Aug 29, 2024
1 parent a3bc053 commit aebade5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions svf-llvm/lib/LLVMUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,11 +849,16 @@ bool LLVMUtil::isHeapAllocExtCallViaRet(const Instruction *inst)
bool isPtrTy = inst->getType()->isPointerTy();
if (const CallInst* call = SVFUtil::dyn_cast<CallInst>(inst))
{
Function* fun = call->getCalledFunction();
const Function* fun = call->getCalledFunction();
if (!fun)
return false;
auto called_llvmval = call->getCalledOperand()->stripPointerCasts();
if (const Function* called_llvmfunc = SVFUtil::dyn_cast<Function>(called_llvmval))
{
fun = LLVMUtil::getDefFunForMultipleModule(called_llvmfunc);
}
bool isAllocOrRealloc = pSet->hasExtFuncAnnotation(fun, "ALLOC_RET") ||
pSet->hasExtFuncAnnotation(fun, "REALLOC_RET");
pSet->hasExtFuncAnnotation(fun, "REALLOC_RET");
return isPtrTy && isAllocOrRealloc;
}
else
Expand Down

0 comments on commit aebade5

Please sign in to comment.