-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
first commit of ConstantVal/Obj #1602
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1602 +/- ##
==========================================
- Coverage 62.99% 62.98% -0.02%
==========================================
Files 246 246
Lines 27412 27561 +149
Branches 4527 4543 +16
==========================================
+ Hits 17269 17358 +89
- Misses 10143 10203 +60
|
svf/include/SVFIR/SVFVariables.h
Outdated
public: | ||
/// Methods for support type inquiry through isa, cast, and dyn_cast: | ||
//@{ | ||
static inline bool classof(const FunValVar*) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be ConstantValVar
svf/include/SVFIR/SVFVariables.h
Outdated
} | ||
static inline bool classof(const ValVar* node) | ||
{ | ||
return node->getNodeKind() == ConstantValNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this classof should be a range, you can refer to https://github.com/SVF-tools/SVF/blob/master/svf/include/SVFIR/SVFVariables.h#L283
svf/include/SVFIR/SVFVariables.h
Outdated
} | ||
static inline bool classof(const SVFVar* node) | ||
{ | ||
return node->getNodeKind() == ConstantValNode; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as before
a.log -- this PR
|
try |
the above is ./SVF-xiao/Debug-build/bin/wpa -fspta ./pldi25/redis-server.bc |
where are the flow-sensitive points-to results? |
--- a.log 2024-12-10 10:44:27.800164570 +1100 PTACallGraph Stats (Andersen analysis)****** Memory SSA Statistics****** Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector |
root@ed434c8a502d:/share# cat diff2 PTACallGraph Stats (Andersen analysis)****** Memory SSA Statistics****** PTACallGraph Stats (Flow-sensitive analysis)****** Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector |
svf/lib/SVFIR/SVFVariables.cpp
Outdated
const std::string ConstantNullPtrValVar::toString() const { | ||
std::string str; | ||
std::stringstream rawstr(str); | ||
rawstr << "ConstantObjVar ID: " << getId(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constantnullptrvalvar
svf/lib/SVFIR/SVFVariables.cpp
Outdated
} | ||
|
||
|
||
const std::string GlobalValueObjVar::toString() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GlobalValueObjVar->GlobalObjVar
svf/include/SVFIR/SVFVariables.h
Outdated
virtual const std::string toString() const; | ||
}; | ||
|
||
class GlobalValueValVar : public ValVar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GlobalValVar
if (chaVtbls.find(vtbl) != chaVtbls.end()) | ||
vtbls.insert(vtbl); | ||
// ptd is global obj var or ptd's base is global val/obj var | ||
if (SVFUtil::isa<GlobalValueValVar, GlobalValueObjVar>(ptdnode)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write a function isGlobalVar(const SVFVar* var)
svf/lib/SABER/SaberCondAllocator.cpp
Outdated
const SVFVar* op0 = cmp->getOpVar(0); | ||
const SVFVar* op1 = cmp->getOpVar(1); | ||
bool a = SVFUtil::dyn_cast<ConstantNullPtrValVar>(op0) || | ||
SVFUtil::dyn_cast<ConstantNullPtrObjVar>(op0); | ||
bool b = SVFUtil::dyn_cast<ConstantNullPtrValVar>(op1) || | ||
SVFUtil::dyn_cast<ConstantNullPtrObjVar>(op1); | ||
bool c = SVFUtil::dyn_cast<SVFConstantNullPtr>(op0->getValue()); | ||
bool d = SVFUtil::dyn_cast<SVFConstantNullPtr>(op1->getValue()); | ||
assert(a == c); | ||
assert(b == d); | ||
if (SVFUtil::isa<ConstantNullPtrValVar, ConstantNullPtrObjVar>(op1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove ab testing code
svf/lib/SABER/SaberSVFGBuilder.cpp
Outdated
@@ -82,7 +82,7 @@ void SaberSVFGBuilder::collectGlobals(BVDataPTAImpl* pta) | |||
if(SVFUtil::isa<DummyObjVar>(pag->getGNode(gepobj->getBaseNode()))) | |||
continue; | |||
} | |||
if(pagNode->hasValue() && SVFUtil::isa<SVFGlobalValue>(pagNode->getValue())) | |||
if(pagNode->hasValue() && SVFUtil::isa<GlobalValueValVar, GlobalValueObjVar>(pagNode)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use isGlobalVar(pagNode) (please refer to previous comments for isGlobalVar)
No description provided.