@@ -436,7 +436,6 @@ void PointerAnalysis::getVFnsFromCHA(const CallICFGNode* cs, VFunSet &vfns)
436436 */
437437void PointerAnalysis::getVFnsFromPts (const CallICFGNode* cs, const PointsTo &target, VFunSet &vfns)
438438{
439-
440439 if (chgraph->csHasVtblsBasedonCHA (cs))
441440 {
442441 Set<const SVFGlobalValue*> vtbls;
@@ -446,13 +445,13 @@ void PointerAnalysis::getVFnsFromPts(const CallICFGNode* cs, const PointsTo &tar
446445 const PAGNode *ptdnode = pag->getGNode (*it);
447446 if (ptdnode->hasValue ())
448447 {
449- // ptd is global obj var or ptd's base is global obj var
450- if (const GlobalValueObjVar *global_vtbl = SVFUtil::dyn_cast< GlobalValueObjVar>(ptdnode)) {
451- const SVFGlobalValue* globalValue = SVFUtil::dyn_cast<SVFGlobalValue>(global_vtbl ->getValue ());
448+ // ptd is global obj var or ptd's base is global val/ obj var
449+ if (SVFUtil::isa<GlobalValueValVar, GlobalValueObjVar>(ptdnode)) {
450+ const SVFGlobalValue* globalValue = SVFUtil::dyn_cast<SVFGlobalValue>(ptdnode ->getValue ());
452451 if (chaVtbls.find (globalValue) != chaVtbls.end ())
453452 vtbls.insert (globalValue);
454453 } else if (const GepObjVar *gep_vtbl = SVFUtil::dyn_cast<GepObjVar>(ptdnode)) {
455- if (SVFUtil::isa<GlobalValueObjVar>(pag->getGNode (gep_vtbl->getBaseNode ()))) {
454+ if (SVFUtil::isa<GlobalValueValVar, GlobalValueObjVar>(pag->getGNode (gep_vtbl->getBaseNode ()))) {
456455 const SVFGlobalValue* globalValue = SVFUtil::dyn_cast<SVFGlobalValue>(gep_vtbl->getValue ());
457456 if (chaVtbls.find (globalValue) != chaVtbls.end ())
458457 vtbls.insert (globalValue);
0 commit comments