Skip to content
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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Conversation

bjjwwang
Copy link
Contributor

@bjjwwang bjjwwang commented Dec 5, 2024

No description provided.

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 59.91379% with 93 lines in your changes missing coverage. Please review.

Project coverage is 62.98%. Comparing base (1464994) to head (67995e3).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
svf/lib/SVFIR/SVFVariables.cpp 20.00% 56 Missing ⚠️
svf/include/SVFIR/SVFVariables.h 60.00% 14 Missing ⚠️
svf-llvm/lib/SVFIRBuilder.cpp 77.50% 9 Missing ⚠️
svf/include/SVFIR/SVFIR.h 86.20% 4 Missing ⚠️
svf/lib/AE/Core/AbstractState.cpp 80.95% 4 Missing ⚠️
svf/lib/SVFIR/SVFFileSystem.cpp 50.00% 4 Missing ⚠️
svf/lib/MemoryModel/AccessPath.cpp 88.88% 1 Missing ⚠️
svf/lib/SABER/SaberCondAllocator.cpp 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
svf-llvm/include/SVF-LLVM/SVFIRBuilder.h 90.62% <100.00%> (+0.07%) ⬆️
svf-llvm/lib/SVFIRExtAPI.cpp 85.24% <100.00%> (ø)
svf/include/Graphs/GenericGraph.h 81.44% <100.00%> (ø)
svf/include/Util/SVFUtil.h 86.00% <ø> (ø)
svf/lib/AE/Svfexe/AbsExtAPI.cpp 89.80% <ø> (+0.87%) ⬆️
svf/lib/MemoryModel/PointerAnalysis.cpp 61.98% <100.00%> (+0.15%) ⬆️
svf/lib/SABER/SaberSVFGBuilder.cpp 93.06% <100.00%> (ø)
svf/lib/SVFIR/SVFIR.cpp 77.65% <100.00%> (ø)
svf/lib/Util/SVFUtil.cpp 45.62% <100.00%> (+2.48%) ⬆️
svf/lib/MemoryModel/AccessPath.cpp 52.74% <88.88%> (+1.09%) ⬆️
... and 7 more

... and 9 files with indirect coverage changes

public:
/// Methods for support type inquiry through isa, cast, and dyn_cast:
//@{
static inline bool classof(const FunValVar*)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ConstantValVar

}
static inline bool classof(const ValVar* node)
{
return node->getNodeKind() == ConstantValNode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
static inline bool classof(const SVFVar* node)
{
return node->getNodeKind() == ConstantValNode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before

@bjjwwang
Copy link
Contributor Author

bjjwwang commented Dec 9, 2024

a.log -- this PR
b.log -- main branch

diff -u a.log b.log
--- a.log       2024-12-09 20:19:25.161144898 +1100
+++ b.log       2024-12-09 20:19:45.921170455 +1100
@@ -1,134 +1,114 @@
 
 *********General Stats***************
-################ (program : redis-server.bc)###############
-AddrsNum            22015
-BBWith2Succ         28770
-BBWith3Succ         1888
-CallsNum            56547
-ConstArrayObj       758
-ConstStructObj      55
+################ (program : teeworlds.bc)###############
+AddrsNum            11550
+BBWith2Succ         13669
+BBWith3Succ         327
+CallsNum            28286
+ConstArrayObj       81
+ConstStructObj      181
 ConstantObj         0
-CopysNum            28176
-FIObjNum            2107
-FSObjNum            7720
-FunctionObjs        4948
-GepsNum             84884
-GlobalObjs          1147
-HeapObjs            278
-IndCallSites        1132
-LoadsNum            52477
-MaxStructSize       17347
-NonPtrObj           9365
-ReturnsNum          13569
-StackObjs           3453
-StoresNum           54386
-TotalCallSite       40687
-TotalFieldObjects   5887
-TotalObjects        9828
-TotalPTASVFStmts    220984
-TotalPointers       497044
-TotalSVFStmts       453480
-VarArrayObj         831
-VarStructObj        1664
+CopysNum            20506
+FIObjNum            1029
+FSObjNum            4718
+FunctionObjs        2306
+GepsNum             59984
+GlobalObjs          1246
+HeapObjs            379
+IndCallSites        3873
+LoadsNum            42600
+MaxStructSize       2127
+NonPtrObj           5680
+ReturnsNum          3425
+StackObjs           1815
+StoresNum           29547
+TotalCallSite       20701
+TotalFieldObjects   10836
+TotalObjects        5748
+TotalPTASVFStmts    142566
+TotalPointers       282530
+TotalSVFStmts       260085
+VarArrayObj         549
+VarStructObj        1645
 ----------------Time and memory stats--------------------
-LLVMIRTime          11.436
-SVFIRTime           12.167
-SymbolTableTime     3.289
+LLVMIRTime          5.483
+SVFIRTime           5.754
+SymbolTableTime     2.262
 #######################################################
 
 *********PTACallGraph Stats (Andersen analysis)***************
-################ (program : redis-server.bc)###############
+################ (program : teeworlds.bc)###############
 ----------------Numbers stats----------------------------
-CalRetPairInCycle   46427
-MaxNodeInCycle      1974
-NodeInCycle         2073
-TotalCycle          22
-TotalEdge           89664
-TotalNode           4948
+CalRetPairInCycle   1161
+MaxNodeInCycle      124
+NodeInCycle         154
+TotalCycle          29
+TotalEdge           19945
+TotalNode           2306
 #######################################################
 
 *********Andersen Pointer Analysis Stats***************
-################ (program : redis-server.bc)###############
+################ (program : teeworlds.bc)###############
 ----------------Time and memory stats--------------------
-AvgIn/OutAddrEdge   0.0989558
-AvgIn/OutCopyEdge   1.20156
-AvgIn/OutEdge       1.59218
-AvgIn/OutLoadEdge   0.146169
-AvgIn/OutStoreEdge  0.145496
-AvgPtsSetSize       168.73
-AvgTopLvlPtsSize    538.37
+AvgIn/OutAddrEdge   0.0732982
+AvgIn/OutCopyEdge   0.894236
+AvgIn/OutEdge       1.30475
+AvgIn/OutLoadEdge   0.233325
+AvgIn/OutStoreEdge  0.103893
+AvgPtsSetSize       52.8968
+AvgTopLvlPtsSize    126.761
 CollapseTime        0
 CopyGepTime         0
 LoadStoreTime       0
-MemoryUsageVmrss    4.16509e+06
-MemoryUsageVmsize   4.16485e+06
+MemoryUsageVmrss    1.09962e+06
+MemoryUsageVmsize   1.09945e+06
 SCCDetectTime       0
 SCCMergeTime        0
-TotalTime           539.133
+TotalTime           130.248
 UpdateCGTime        0
 ----------------Numbers stats----------------------------
-AddrProcessed       17887
-CopyProcessed       313945
-DummyFieldPtrs      2305
-FieldObjs           5887
-GepProcessed        233776
-IndCallSites        1132
-IndEdgeSolved       50000
-LoadProcessed       97972101
-LocalVarInRecur     728
+AddrProcessed       9220
+CopyProcessed       157144
+DummyFieldPtrs      1447
+FieldObjs           10836
+GepProcessed        150625
+IndCallSites        3873
+IndEdgeSolved       3112
+LoadProcessed       25960025
+LocalVarInRecur     166
 MaxInAddrEdge       1
-MaxInCopyEdge       5606
-MaxInLoadEdge       4085
-MaxInStoreEdge      104
-MaxNodesInSCC       627
-MaxOutAddrEdge      8123
-MaxOutCopyEdge      18295
-MaxOutLoadEdge      153
-MaxOutStoreEdge     7137
-MaxPtsSetSize       1743
-MemObjects          9828
-NodesInCycles       3068
-NullPointer         11736
-NumOfAddrs          16168
-NumOfCGEdge         243972
-NumOfCGNode         167979
-NumOfCopys          112676
+MaxInCopyEdge       760
+MaxInLoadEdge       4498
+MaxInStoreEdge      183
+MaxNodesInSCC       5822
+MaxOutAddrEdge      3474
+MaxOutCopyEdge      7147
+MaxOutLoadEdge      195
+MaxOutStoreEdge     4529
+MaxPtsSetSize       838
+MemObjects          5748
+NodesInCycles       8022
+NullPointer         17946
+NumOfAddrs          8656
+NumOfCGEdge         145426
+NumOfCGNode         124561
+NumOfCopys          46543
 NumOfFieldExpand    0
-NumOfGeps           83642
-NumOfLoads          23882
+NumOfGeps           59060
+NumOfLoads          27554
 NumOfSCCDetect      19
 NumOfSFRs           0
-NumOfStores         23772
-NumOfValidNode      163386
-NumOfValidObjNode   11086
-Pointers            494739
+NumOfStores         12269
+NumOfValidNode      118093
+NumOfValidObjNode   9025
+Pointers            281083
 PointsToBlkPtr      0
-PointsToConstPtr    23159
-SolveIterations     19
-StoreProcessed      18514240
-TotalCycleNum       595
-TotalObjects        15715
-TotalPWCCycleNum    145
-TotalPointers       497044
-#######################################################
-
-****Persistent Points-To Cache Statistics: Andersen's analysis bitvector****
-################ (program : redis-server.bc)###############
-UniquePointsToSets       44837
-TotalUnions              673101
-PropertyUnions           222667
-UniqueUnions             19262
-LookupUnions             395179
-PreemptiveUnions         35993
-TotalComplements         3364380
-PropertyComplements      2998769
-UniqueComplements        16887
-LookupComplements        331839
-PreemptiveComplements    16885
-TotalIntersections       4184863
-PropertyIntersections    4147522
-UniqueIntersections      843
-LookupIntersections      2204
-PreemptiveIntersections  34294
+PointsToConstPtr    16353
+SolveIterations     20
+StoreProcessed      8611496
+TotalCycleNum       602
+TotalObjects        16584
+TotalPWCCycleNum    37
+TotalPointers       282530
 #######################################################

@yuleisui
Copy link
Collaborator

yuleisui commented Dec 9, 2024

try wpa -fspta

@bjjwwang bjjwwang changed the title [WIP] first commit of ConstantVal/Obj first commit of ConstantVal/Obj Dec 9, 2024
@bjjwwang
Copy link
Contributor Author

bjjwwang commented Dec 9, 2024

a -fspta

the above is ./SVF-xiao/Debug-build/bin/wpa -fspta ./pldi25/redis-server.bc

@yuleisui
Copy link
Collaborator

yuleisui commented Dec 9, 2024

a -fspta

the above is ./SVF-xiao/Debug-build/bin/wpa -fspta ./pldi25/redis-server.bc

where are the flow-sensitive points-to results?

@jumormt
Copy link
Contributor

jumormt commented Dec 9, 2024

--- a.log 2024-12-10 10:44:27.800164570 +1100
+++ b.log 2024-12-10 10:40:23.767635565 +1100
@@ -31,9 +31,9 @@
VarArrayObj 831
VarStructObj 1664
----------------Time and memory stats--------------------
-LLVMIRTime 5.619
-SVFIRTime 3.565
-SymbolTableTime 0.612
+LLVMIRTime 5.482
+SVFIRTime 3.389
+SymbolTableTime 0.613
#######################################################

PTACallGraph Stats (Andersen analysis)******
@@ -60,11 +60,11 @@
CollapseTime 0
CopyGepTime 0
LoadStoreTime 0
-MemoryUsageVmrss 4.16537e+06
-MemoryUsageVmsize 4.16482e+06
+MemoryUsageVmrss 4.16516e+06
+MemoryUsageVmsize 4.16483e+06
SCCDetectTime 0
SCCMergeTime 0
-TotalTime 213.017
+TotalTime 279.132
UpdateCGTime 0
----------------Numbers stats----------------------------
AddrProcessed 17887
@@ -115,32 +115,32 @@
Persistent Points-To Cache Statistics: Andersen's analysis bitvector
################ (program : redis-server.bc)###############
UniquePointsToSets 44837
-TotalUnions 673092
+TotalUnions 673107
PropertyUnions 222667
-UniqueUnions 19260
-LookupUnions 395181
-PreemptiveUnions 35984
+UniqueUnions 19259
+LookupUnions 395182
+PreemptiveUnions 35999
TotalComplements 3364380
PropertyComplements 2998769
UniqueComplements 16887
LookupComplements 331839
PreemptiveComplements 16885
-TotalIntersections 4184856
-PropertyIntersections 4147585
-UniqueIntersections 836
-LookupIntersections 2148
-PreemptiveIntersections 34287
+TotalIntersections 4184872
+PropertyIntersections 4147525
+UniqueIntersections 856
+LookupIntersections 2188
+PreemptiveIntersections 34303
#######################################################

Memory SSA Statistics******
################ (program : redis-server.bc)###############
----------------Time and memory stats--------------------
AverageRegSize 85.727
-GenMUCHITime 3.254
-GenRegionTime 769.571
-InsertPHITime 0.831
-SSARenameTime 0.134
-TotalMSSATime 773.798
+GenMUCHITime 3.355
+GenRegionTime 779.905
+InsertPHITime 0.775
+SSARenameTime 0.126
+TotalMSSATime 784.169
----------------Numbers stats----------------------------
BBHasMSSAPhi 10755
CSChiNode 111246
@@ -163,13 +163,13 @@
SVFG Statistics******
################ (program : redis-server.bc)###############
----------------Time and memory stats--------------------
-ATNodeTime 1.004
+ATNodeTime 1.017
AvgWeight 167.794
ConnDirEdgeTime 0
-ConnIndEdgeTime 5.659
+ConnIndEdgeTime 5.656
OptTime 0
TLNodeTime 0
-TotalTime 6.663
+TotalTime 6.673
----------------Numbers stats----------------------------
ActualIn 163193
ActualOut 111246
@@ -233,16 +233,16 @@
GepTime 0
IndirectPropaTime 0
LoadTime 0
-MemoryUsageVmrss 1.48305e+07
-MemoryUsageVmsize 1.483e+07
+MemoryUsageVmrss 1.48183e+07
+MemoryUsageVmsize 1.48178e+07
PhiTime 0
ProcessTime 0
PropagationTime 0
SCCTime 0
-SolveTime 9502.44
+SolveTime 9411.85
StoreTime 0
Strong/WeakUpdTime 0
-TotalTime 10509.5
+TotalTime 10495.9
UpdateCGTime 0
----------------Numbers stats----------------------------
AI_SNodesHaveIN 0
@@ -280,13 +280,13 @@
PotentialVarHaveOUT 0
ProcessedAParam 0
ProcessedAddr 107322
-ProcessedCopy 215743
+ProcessedCopy 213707
ProcessedFRet 0
-ProcessedGep 1097893
-ProcessedLoad 1934671
-ProcessedMSSANode 16573671
-ProcessedPhi 149777
-ProcessedStore 538751
+ProcessedGep 1090631
+ProcessedLoad 1928554
+ProcessedMSSANode 16511154
+ProcessedPhi 149344
+ProcessedStore 537642
SNodesHaveIN 0
SNodesHaveOUT 0
ST_SNodesHaveIN 0
@@ -318,12 +318,12 @@

Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector
################ (program : redis-server.bc)###############
-UniquePointsToSets 35360
-TotalUnions 27248613143
-PropertyUnions 21738792502
-UniqueUnions 97254
-LookupUnions 5509594619
-PreemptiveUnions 128768
+UniquePointsToSets 34995
+TotalUnions 27082742088
+PropertyUnions 21568270655
+UniqueUnions 92147
+LookupUnions 5514257258
+PreemptiveUnions 122028
TotalComplements 0
PropertyComplements 0
UniqueComplements 0

@bjjwwang
Copy link
Contributor Author

root@ed434c8a502d:/share# cat diff2
--- a.log 2024-12-12 13:26:49.908444546 +0000
+++ b.log 2024-12-12 13:35:27.329557163 +0000
@@ -31,9 +31,9 @@
VarArrayObj 831
VarStructObj 1664
----------------Time and memory stats--------------------
-LLVMIRTime 5.457
-SVFIRTime 3.466
-SymbolTableTime 0.598
+LLVMIRTime 5.595
+SVFIRTime 3.462
+SymbolTableTime 0.633
#######################################################

PTACallGraph Stats (Andersen analysis)******
@@ -61,10 +61,10 @@
CopyGepTime 0
LoadStoreTime 0
MemoryUsageVmrss 4.16516e+06
-MemoryUsageVmsize 4.16488e+06
+MemoryUsageVmsize 4.16483e+06
SCCDetectTime 0
SCCMergeTime 0
-TotalTime 210.245
+TotalTime 208.855
UpdateCGTime 0
----------------Numbers stats----------------------------
AddrProcessed 17887
@@ -115,47 +115,47 @@
Persistent Points-To Cache Statistics: Andersen's analysis bitvector
################ (program : redis-server.bc)###############
UniquePointsToSets 44837
-TotalUnions 673091
+TotalUnions 673106
PropertyUnions 222667
-UniqueUnions 19260
-LookupUnions 395181
-PreemptiveUnions 35983
+UniqueUnions 19259
+LookupUnions 395182
+PreemptiveUnions 35998
TotalComplements 3364380
PropertyComplements 2998769
UniqueComplements 16887
LookupComplements 331839
PreemptiveComplements 16885
-TotalIntersections 4184855
-PropertyIntersections 4147580
-UniqueIntersections 839
-LookupIntersections 2150
-PreemptiveIntersections 34286
+TotalIntersections 4184871
+PropertyIntersections 4147507
+UniqueIntersections 836
+LookupIntersections 2226
+PreemptiveIntersections 34302
#######################################################

Memory SSA Statistics******
################ (program : redis-server.bc)###############
----------------Time and memory stats--------------------
-AverageRegSize 85.224
-GenMUCHITime 3.293
-GenRegionTime 789.605
-InsertPHITime 0.815
-SSARenameTime 0.129
-TotalMSSATime 793.847
+AverageRegSize 85.727
+GenMUCHITime 3.252
+GenRegionTime 778.482
+InsertPHITime 0.816
+SSARenameTime 0.156
+TotalMSSATime 782.711
----------------Numbers stats----------------------------
BBHasMSSAPhi 10755
-CSChiNode 111265
+CSChiNode 111246
CSHasChi 22679
CSHasMu 24549
-CSMuNode 163259
-FunEntryChi 24312
+CSMuNode 163193
+FunEntryChi 24294
FunHasEntryChi 3967
FunHasRetMu 4630
-FunRetMu 24243
+FunRetMu 24225
LoadHasMu 24346
-LoadMuNode 43215
-MSSAPhi 59384
+LoadMuNode 43211
+MSSAPhi 59315
MaxRegSize 1650
-MemRegions 4535
+MemRegions 4538
StoreChiNode 14269
StoreHasChi 10511
#######################################################
@@ -163,16 +163,16 @@
SVFG Statistics******
################ (program : redis-server.bc)###############
----------------Time and memory stats--------------------
-ATNodeTime 1.011
-AvgWeight 167.302
+ATNodeTime 1.005
+AvgWeight 167.794
ConnDirEdgeTime 0
-ConnIndEdgeTime 5.624
+ConnIndEdgeTime 5.588
OptTime 0
TLNodeTime 0
-TotalTime 6.635
+TotalTime 6.593
----------------Numbers stats----------------------------
-ActualIn 163259
-ActualOut 111265
+ActualIn 163193
+ActualOut 111246
ActualParam 57426
ActualRet 7530
Addr 17887
@@ -184,25 +184,25 @@
DirectCallEdge 41434
DirectEdge 292904
DirectRetEdge 7351
-FormalIn 24312
-FormalOut 24243
+FormalIn 24294
+FormalOut 24225
FormalParam 7869
FormalRet 795
Gep 84884
-IndCallEdge 190108
-IndRetEdge 124715
-IndirectEdge 717441
-IndirectEdgeLabels 120029610
+IndCallEdge 189998
+IndRetEdge 124671
+IndirectEdge 717052
+IndirectEdgeLabels 120316790
Load 24346
-MSSAPhi 59384
+MSSAPhi 59315
MaxInDegree 9710
MaxIndInDeg 9710
MaxIndOutDeg 2458
MaxOutDegree 9600
PHI 6776
Store 24168
-TotalEdge 1010345
-TotalNode 628283
+TotalEdge 1009956
+TotalNode 628093
#######################################################

PTACallGraph Stats (Flow-sensitive analysis)******
@@ -222,7 +222,7 @@
################ (program : redis-server.bc)###############
----------------Time and memory stats--------------------
AddrTime 0
-AverageSCCSize 420.838
+AverageSCCSize 420.64
AvgAddrTakenVarPts 1104.9
AvgINPtsSize 0
AvgOUTPtsSize 0
@@ -233,16 +233,16 @@
GepTime 0
IndirectPropaTime 0
LoadTime 0
-MemoryUsageVmrss 1.4798e+07
-MemoryUsageVmsize 1.47973e+07
+MemoryUsageVmrss 1.48268e+07
+MemoryUsageVmsize 1.48265e+07
PhiTime 0
ProcessTime 0
PropagationTime 0
SCCTime 0
-SolveTime 9070.69
+SolveTime 9587.95
StoreTime 0
Strong/WeakUpdTime 0
-TotalTime 10095.5
+TotalTime 10600
UpdateCGTime 0
----------------Numbers stats----------------------------
AI_SNodesHaveIN 0
@@ -264,12 +264,12 @@
MaxINPtsSize 0
MaxOUTPtsSize 0
MaxPtsSize 1709
-MaxSCCSize 361463
+MaxSCCSize 361291
MaxTopLvlPtsSize 1709
MemObjects 9828
NullPointer 13874
NumOfAddrTakenVar 2168911
-NumOfNodesInSCC 365708
+NumOfNodesInSCC 365536
NumOfSCC 869
PHI_SNodesHaveIN 0
PHI_SNodesHaveOUT 0
@@ -280,13 +280,13 @@
PotentialVarHaveOUT 0
ProcessedAParam 0
ProcessedAddr 107322
-ProcessedCopy 216693
+ProcessedCopy 213260
ProcessedFRet 0
-ProcessedGep 1101353
-ProcessedLoad 1928908
-ProcessedMSSANode 16409435
-ProcessedPhi 151381
-ProcessedStore 536643
+ProcessedGep 1090961
+ProcessedLoad 1934754
+ProcessedMSSANode 16488100
+ProcessedPhi 148254
+ProcessedStore 535527
SNodesHaveIN 0
SNodesHaveOUT 0
ST_SNodesHaveIN 0
@@ -318,12 +318,12 @@

Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector
################ (program : redis-server.bc)###############
-UniquePointsToSets 35064
-TotalUnions 17055262354
-PropertyUnions 12906332552
-UniqueUnions 95677
-LookupUnions 4148707705
-PreemptiveUnions 126420
+UniquePointsToSets 35237
+TotalUnions 27205888865
+PropertyUnions 21819750770
+UniqueUnions 94440
+LookupUnions 5385918552
+PreemptiveUnions 125103
TotalComplements 0
PropertyComplements 0
UniqueComplements 0

const std::string ConstantNullPtrValVar::toString() const {
std::string str;
std::stringstream rawstr(str);
rawstr << "ConstantObjVar ID: " << getId();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constantnullptrvalvar

}


const std::string GlobalValueObjVar::toString() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GlobalValueObjVar->GlobalObjVar

virtual const std::string toString() const;
};

class GlobalValueValVar : public ValVar
Copy link
Contributor

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)) {
Copy link
Contributor

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)

Comment on lines 402 to 412
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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove ab testing code

@@ -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))
Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants