Skip to content

Commit

Permalink
Merge pull request #1282 from jumormt/vfg
Browse files Browse the repository at this point in the history
(fix issue #1279) connect actual to formal vfgnode for full svfg
  • Loading branch information
yuleisui authored Dec 12, 2023
2 parents a83aec2 + 6604ef7 commit 7e2b3af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions svf/lib/Graphs/SVFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,20 +595,20 @@ void SVFG::getInterVFEdgesForIndirectCallSite(const CallICFGNode* callICFGNode,
{
const PAGNode *cs_arg = *csArgIt;
const PAGNode *fun_arg = *funArgIt;
if (fun_arg->isPointer() && cs_arg->isPointer())
if (isInterestedPAGNode(fun_arg) && isInterestedPAGNode(cs_arg))
getInterVFEdgeAtIndCSFromAPToFP(cs_arg, fun_arg, callICFGNode, csId, edges);
}
assert(funArgIt == funArgEit && "function has more arguments than call site");
if (callee->isVarArg())
{
NodeID varFunArg = pag->getVarargNode(callee);
const PAGNode* varFunArgNode = pag->getGNode(varFunArg);
if (varFunArgNode->isPointer())
if (isInterestedPAGNode(varFunArgNode))
{
for (; csArgIt != csArgEit; csArgIt++)
{
const PAGNode *cs_arg = *csArgIt;
if (cs_arg->isPointer())
if (isInterestedPAGNode(cs_arg))
getInterVFEdgeAtIndCSFromAPToFP(cs_arg, varFunArgNode, callICFGNode, csId, edges);
}
}
Expand All @@ -620,7 +620,7 @@ void SVFG::getInterVFEdgesForIndirectCallSite(const CallICFGNode* callICFGNode,
{
const PAGNode* cs_return = pag->getCallSiteRet(retICFGNode);
const PAGNode* fun_return = pag->getFunRet(callee);
if (cs_return->isPointer() && fun_return->isPointer())
if (isInterestedPAGNode(cs_return) && isInterestedPAGNode(fun_return))
getInterVFEdgeAtIndCSFromFRToAR(fun_return, cs_return, csId, edges);
}

Expand Down
8 changes: 4 additions & 4 deletions svf/lib/Graphs/VFG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ void VFG::connectCallerAndCallee(const CallICFGNode* callBlockNode, const SVFFun
{
const PAGNode *cs_arg = *csArgIt;
const PAGNode *fun_arg = *funArgIt;
if (fun_arg->isPointer() && cs_arg->isPointer())
if (isInterestedPAGNode(cs_arg) && isInterestedPAGNode(fun_arg))
connectAParamAndFParam(cs_arg, fun_arg, callBlockNode, csId, edges);
}
assert(funArgIt == funArgEit && "function has more arguments than call site");
Expand All @@ -996,12 +996,12 @@ void VFG::connectCallerAndCallee(const CallICFGNode* callBlockNode, const SVFFun
{
NodeID varFunArg = pag->getVarargNode(callee);
const PAGNode* varFunArgNode = pag->getGNode(varFunArg);
if (varFunArgNode->isPointer())
if (isInterestedPAGNode(varFunArgNode))
{
for (; csArgIt != csArgEit; csArgIt++)
{
const PAGNode *cs_arg = *csArgIt;
if (cs_arg->isPointer())
if (isInterestedPAGNode(cs_arg))
connectAParamAndFParam(cs_arg, varFunArgNode, callBlockNode, csId, edges);
}
}
Expand All @@ -1013,7 +1013,7 @@ void VFG::connectCallerAndCallee(const CallICFGNode* callBlockNode, const SVFFun
{
const PAGNode* cs_return = pag->getCallSiteRet(retBlockNode);
const PAGNode* fun_return = pag->getFunRet(callee);
if (cs_return->isPointer() && fun_return->isPointer())
if (isInterestedPAGNode(cs_return) && isInterestedPAGNode(fun_return))
connectFRetAndARet(fun_return, cs_return, csId, edges);
}
}
Expand Down

0 comments on commit 7e2b3af

Please sign in to comment.