Skip to content

Commit

Permalink
Merge pull request #1031 from timmyyuan/ting/connect-variadic-callee
Browse files Browse the repository at this point in the history
Connect variadic callees in the call graph
  • Loading branch information
yuleisui authored Mar 15, 2023
2 parents 1982615 + fc35775 commit 30cf19f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions svf/lib/MemoryModel/PointerAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void PointerAnalysis::resolveIndCalls(const CallICFGNode* cs, const PointsTo& ta
const SVFFunction* callee = calleefun->getDefFunForMultipleModule();

/// if the arg size does not match then we do not need to connect this parameter
/// even if the callee is a variadic function (the first parameter of variadic function is its paramter number)
/// unless the callee is a variadic function (the first parameter of variadic function is its paramter number)
if(matchArgs(cs, callee) == false)
continue;

Expand All @@ -434,7 +434,7 @@ void PointerAnalysis::resolveIndCalls(const CallICFGNode* cs, const PointsTo& ta
*/
bool PointerAnalysis::matchArgs(const CallICFGNode* cs, const SVFFunction* callee)
{
if(ThreadAPI::getThreadAPI()->isTDFork(cs->getCallSite()))
if(callee->isVarArg() || ThreadAPI::getThreadAPI()->isTDFork(cs->getCallSite()))
return true;
else
return SVFUtil::getSVFCallSite(cs->getCallSite()).arg_size() == callee->arg_size();
Expand Down

0 comments on commit 30cf19f

Please sign in to comment.