svf-lib 1.0.1375 → 1.0.1377

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/SVF-osx/Release-build/svf-llvm/libSvfLLVM.a +0 -0
  2. package/package.json +1 -1
  3. package/SVF-linux/svf/include/include/AbstractExecution/AbstractValue.h +0 -79
  4. package/SVF-linux/svf/include/include/AbstractExecution/AddressValue.h +0 -210
  5. package/SVF-linux/svf/include/include/AbstractExecution/ExeState.h +0 -223
  6. package/SVF-linux/svf/include/include/AbstractExecution/IntervalExeState.h +0 -425
  7. package/SVF-linux/svf/include/include/AbstractExecution/IntervalValue.h +0 -868
  8. package/SVF-linux/svf/include/include/AbstractExecution/NumericLiteral.h +0 -406
  9. package/SVF-linux/svf/include/include/AbstractExecution/RelExeState.h +0 -225
  10. package/SVF-linux/svf/include/include/AbstractExecution/RelationSolver.h +0 -68
  11. package/SVF-linux/svf/include/include/AbstractExecution/SVFIR2ItvExeState.h +0 -186
  12. package/SVF-linux/svf/include/include/AbstractExecution/WTO.h +0 -845
  13. package/SVF-linux/svf/include/include/CFL/CFGNormalizer.h +0 -84
  14. package/SVF-linux/svf/include/include/CFL/CFLAlias.h +0 -176
  15. package/SVF-linux/svf/include/include/CFL/CFLBase.h +0 -115
  16. package/SVF-linux/svf/include/include/CFL/CFLData.h +0 -316
  17. package/SVF-linux/svf/include/include/CFL/CFLDataBuilder.h +0 -91
  18. package/SVF-linux/svf/include/include/CFL/CFLGramGraphChecker.h +0 -74
  19. package/SVF-linux/svf/include/include/CFL/CFLGrammar.h +0 -468
  20. package/SVF-linux/svf/include/include/CFL/CFLGrammar.txt +0 -15
  21. package/SVF-linux/svf/include/include/CFL/CFLGraphBuilder.h +0 -193
  22. package/SVF-linux/svf/include/include/CFL/CFLSolver.h +0 -136
  23. package/SVF-linux/svf/include/include/CFL/CFLStat.h +0 -67
  24. package/SVF-linux/svf/include/include/CFL/CFLVF.h +0 -65
  25. package/SVF-linux/svf/include/include/CFL/GrammarBuilder.h +0 -100
  26. package/SVF-linux/svf/include/include/CFL/PEGGrammar.txt +0 -11
  27. package/SVF-linux/svf/include/include/CFL/VFG.txt +0 -7
  28. package/SVF-linux/svf/include/include/DDA/ContextDDA.h +0 -230
  29. package/SVF-linux/svf/include/include/DDA/DDAClient.h +0 -168
  30. package/SVF-linux/svf/include/include/DDA/DDAPass.h +0 -99
  31. package/SVF-linux/svf/include/include/DDA/DDAStat.h +0 -138
  32. package/SVF-linux/svf/include/include/DDA/DDAVFSolver.h +0 -789
  33. package/SVF-linux/svf/include/include/DDA/FlowDDA.h +0 -178
  34. package/SVF-linux/svf/include/include/FastCluster/LICENSE.TXT +0 -13
  35. package/SVF-linux/svf/include/include/FastCluster/fastcluster.h +0 -80
  36. package/SVF-linux/svf/include/include/Graphs/CFLGraph.h +0 -215
  37. package/SVF-linux/svf/include/include/Graphs/CHG.h +0 -351
  38. package/SVF-linux/svf/include/include/Graphs/ConsG.h +0 -408
  39. package/SVF-linux/svf/include/include/Graphs/ConsGEdge.h +0 -353
  40. package/SVF-linux/svf/include/include/Graphs/ConsGNode.h +0 -391
  41. package/SVF-linux/svf/include/include/Graphs/DOTGraphTraits.h +0 -188
  42. package/SVF-linux/svf/include/include/Graphs/GenericGraph.h +0 -620
  43. package/SVF-linux/svf/include/include/Graphs/GraphPrinter.h +0 -111
  44. package/SVF-linux/svf/include/include/Graphs/GraphTraits.h +0 -150
  45. package/SVF-linux/svf/include/include/Graphs/GraphWriter.h +0 -380
  46. package/SVF-linux/svf/include/include/Graphs/ICFG.h +0 -331
  47. package/SVF-linux/svf/include/include/Graphs/ICFGEdge.h +0 -264
  48. package/SVF-linux/svf/include/include/Graphs/ICFGNode.h +0 -523
  49. package/SVF-linux/svf/include/include/Graphs/ICFGStat.h +0 -164
  50. package/SVF-linux/svf/include/include/Graphs/IRGraph.h +0 -243
  51. package/SVF-linux/svf/include/include/Graphs/PTACallGraph.h +0 -471
  52. package/SVF-linux/svf/include/include/Graphs/SVFG.h +0 -490
  53. package/SVF-linux/svf/include/include/Graphs/SVFGEdge.h +0 -237
  54. package/SVF-linux/svf/include/include/Graphs/SVFGNode.h +0 -513
  55. package/SVF-linux/svf/include/include/Graphs/SVFGOPT.h +0 -362
  56. package/SVF-linux/svf/include/include/Graphs/SVFGStat.h +0 -273
  57. package/SVF-linux/svf/include/include/Graphs/ThreadCallGraph.h +0 -422
  58. package/SVF-linux/svf/include/include/Graphs/VFG.h +0 -664
  59. package/SVF-linux/svf/include/include/Graphs/VFGEdge.h +0 -295
  60. package/SVF-linux/svf/include/include/Graphs/VFGNode.h +0 -1197
  61. package/SVF-linux/svf/include/include/MSSA/MSSAMuChi.h +0 -722
  62. package/SVF-linux/svf/include/include/MSSA/MemPartition.h +0 -169
  63. package/SVF-linux/svf/include/include/MSSA/MemRegion.h +0 -491
  64. package/SVF-linux/svf/include/include/MSSA/MemSSA.h +0 -452
  65. package/SVF-linux/svf/include/include/MSSA/SVFGBuilder.h +0 -98
  66. package/SVF-linux/svf/include/include/MTA/FSMPTA.h +0 -270
  67. package/SVF-linux/svf/include/include/MTA/LockAnalysis.h +0 -517
  68. package/SVF-linux/svf/include/include/MTA/MHP.h +0 -565
  69. package/SVF-linux/svf/include/include/MTA/MTA.h +0 -101
  70. package/SVF-linux/svf/include/include/MTA/MTAResultValidator.h +0 -448
  71. package/SVF-linux/svf/include/include/MTA/MTAStat.h +0 -74
  72. package/SVF-linux/svf/include/include/MTA/PCG.h +0 -229
  73. package/SVF-linux/svf/include/include/MTA/TCT.h +0 -599
  74. package/SVF-linux/svf/include/include/MemoryModel/AbstractPointsToDS.h +0 -316
  75. package/SVF-linux/svf/include/include/MemoryModel/ConditionalPT.h +0 -878
  76. package/SVF-linux/svf/include/include/MemoryModel/LocationSet.h +0 -148
  77. package/SVF-linux/svf/include/include/MemoryModel/MutablePointsToDS.h +0 -1025
  78. package/SVF-linux/svf/include/include/MemoryModel/PersistentPointsToCache.h +0 -463
  79. package/SVF-linux/svf/include/include/MemoryModel/PersistentPointsToDS.h +0 -955
  80. package/SVF-linux/svf/include/include/MemoryModel/PointerAnalysis.h +0 -452
  81. package/SVF-linux/svf/include/include/MemoryModel/PointerAnalysisImpl.h +0 -590
  82. package/SVF-linux/svf/include/include/MemoryModel/PointsTo.h +0 -255
  83. package/SVF-linux/svf/include/include/MemoryModel/SVFLoop.h +0 -164
  84. package/SVF-linux/svf/include/include/SABER/DoubleFreeChecker.h +0 -76
  85. package/SVF-linux/svf/include/include/SABER/FileChecker.h +0 -82
  86. package/SVF-linux/svf/include/include/SABER/LeakChecker.h +0 -124
  87. package/SVF-linux/svf/include/include/SABER/ProgSlice.h +0 -313
  88. package/SVF-linux/svf/include/include/SABER/SaberCheckerAPI.h +0 -166
  89. package/SVF-linux/svf/include/include/SABER/SaberCondAllocator.h +0 -310
  90. package/SVF-linux/svf/include/include/SABER/SaberSVFGBuilder.h +0 -104
  91. package/SVF-linux/svf/include/include/SABER/SrcSnkDDA.h +0 -321
  92. package/SVF-linux/svf/include/include/SABER/SrcSnkSolver.h +0 -186
  93. package/SVF-linux/svf/include/include/SVFIR/PAGBuilderFromFile.h +0 -80
  94. package/SVF-linux/svf/include/include/SVFIR/SVFIR.h +0 -659
  95. package/SVF-linux/svf/include/include/SVFIR/SVFModule.h +0 -233
  96. package/SVF-linux/svf/include/include/SVFIR/SVFStatements.h +0 -1136
  97. package/SVF-linux/svf/include/include/SVFIR/SVFType.h +0 -527
  98. package/SVF-linux/svf/include/include/SVFIR/SVFValue.h +0 -1120
  99. package/SVF-linux/svf/include/include/SVFIR/SVFVariables.h +0 -721
  100. package/SVF-linux/svf/include/include/SVFIR/SymbolTableInfo.h +0 -597
  101. package/SVF-linux/svf/include/include/Util/Annotator.h +0 -180
  102. package/SVF-linux/svf/include/include/Util/BitVector.h +0 -55
  103. package/SVF-linux/svf/include/include/Util/CallGraphBuilder.h +0 -74
  104. package/SVF-linux/svf/include/include/Util/Casting.h +0 -426
  105. package/SVF-linux/svf/include/include/Util/CommandLine.h +0 -530
  106. package/SVF-linux/svf/include/include/Util/CoreBitVector.h +0 -214
  107. package/SVF-linux/svf/include/include/Util/CppUtil.h +0 -81
  108. package/SVF-linux/svf/include/include/Util/CxtStmt.h +0 -501
  109. package/SVF-linux/svf/include/include/Util/DPItem.h +0 -618
  110. package/SVF-linux/svf/include/include/Util/ExtAPI.h +0 -339
  111. package/SVF-linux/svf/include/include/Util/ExtAPI.json +0 -5707
  112. package/SVF-linux/svf/include/include/Util/GraphReachSolver.h +0 -186
  113. package/SVF-linux/svf/include/include/Util/NodeIDAllocator.h +0 -194
  114. package/SVF-linux/svf/include/include/Util/Options.h +0 -266
  115. package/SVF-linux/svf/include/include/Util/PTAStat.h +0 -65
  116. package/SVF-linux/svf/include/include/Util/SCC.h +0 -354
  117. package/SVF-linux/svf/include/include/Util/SVFStat.h +0 -100
  118. package/SVF-linux/svf/include/include/Util/SVFUtil.h +0 -660
  119. package/SVF-linux/svf/include/include/Util/SparseBitVector.h +0 -1202
  120. package/SVF-linux/svf/include/include/Util/ThreadAPI.h +0 -330
  121. package/SVF-linux/svf/include/include/Util/WorkList.h +0 -317
  122. package/SVF-linux/svf/include/include/Util/Z3Expr.h +0 -318
  123. package/SVF-linux/svf/include/include/Util/cJSON.h +0 -300
  124. package/SVF-linux/svf/include/include/Util/iterator.h +0 -407
  125. package/SVF-linux/svf/include/include/Util/iterator_range.h +0 -76
  126. package/SVF-linux/svf/include/include/WPA/Andersen.h +0 -416
  127. package/SVF-linux/svf/include/include/WPA/AndersenPWC.h +0 -160
  128. package/SVF-linux/svf/include/include/WPA/CSC.h +0 -95
  129. package/SVF-linux/svf/include/include/WPA/FlowSensitive.h +0 -317
  130. package/SVF-linux/svf/include/include/WPA/Steensgaard.h +0 -126
  131. package/SVF-linux/svf/include/include/WPA/TypeAnalysis.h +0 -83
  132. package/SVF-linux/svf/include/include/WPA/VersionedFlowSensitive.h +0 -287
  133. package/SVF-linux/svf/include/include/WPA/WPAFSSolver.h +0 -254
  134. package/SVF-linux/svf/include/include/WPA/WPAPass.h +0 -119
  135. package/SVF-linux/svf/include/include/WPA/WPASolver.h +0 -205
  136. package/SVF-linux/svf/include/include/WPA/WPAStat.h +0 -222
  137. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/BasicTypes.h +0 -250
  138. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/BreakConstantExpr.h +0 -94
  139. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/CHGBuilder.h +0 -73
  140. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/DCHG.h +0 -484
  141. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/GEPTypeBridgeIterator.h +0 -183
  142. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/ICFGBuilder.h +0 -106
  143. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/LLVMLoopAnalysis.h +0 -61
  144. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/LLVMModule.h +0 -360
  145. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/LLVMUtil.h +0 -466
  146. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/SVFIRBuilder.h +0 -417
  147. package/SVF-linux/svf-llvm/include/SVF-LLVM/SVF-LLVM/SymbolTableBuilder.h +0 -110
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1375",
3
+ "version": "1.0.1377",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,79 +0,0 @@
1
- //===- AbstractValue.h --Abstract Value for domains---------------------------//
2
- //
3
- // SVF: Static Value-Flow Analysis
4
- //
5
- // Copyright (C) <2013-2022> <Yulei Sui>
6
- //
7
-
8
- // This program is free software: you can redistribute it and/or modify
9
- // it under the terms of the GNU General Public License as published by
10
- // the Free Software Foundation, either version 3 of the License, or
11
- // (at your option) any later version.
12
-
13
- // This program is distributed in the hope that it will be useful,
14
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- // GNU General Public License for more details.
17
-
18
- // You should have received a copy of the GNU General Public License
19
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- //
21
- //===----------------------------------------------------------------------===//
22
- /*
23
- * AbstractValue.h
24
- *
25
- * Created on: Aug 4, 2022
26
- * Author: Xiao Cheng, Jiawei Wang
27
- *
28
- */
29
-
30
- #ifndef Z3_EXAMPLE_ABSTRACTVALUE_H
31
- #define Z3_EXAMPLE_ABSTRACTVALUE_H
32
-
33
- #include <type_traits>
34
- #include <string>
35
- #include "SVFIR/SVFValue.h"
36
-
37
- namespace SVF
38
- {
39
-
40
- class IntervalValue;
41
-
42
- /*!
43
- * Base class of abstract value
44
- */
45
- class AbstractValue
46
- {
47
- public:
48
- /// Abstract value kind
49
- enum AbstractValueK
50
- {
51
- IntervalK, ConcreteK, AddressK
52
- };
53
- private:
54
- AbstractValueK _kind;
55
-
56
- public:
57
- AbstractValue(AbstractValueK kind) : _kind(kind) {}
58
-
59
- virtual ~AbstractValue() = default;
60
-
61
- AbstractValue(const AbstractValue &) noexcept = default;
62
-
63
- AbstractValue(AbstractValue &&) noexcept = default;
64
-
65
- AbstractValue &operator=(const AbstractValue &) noexcept = default;
66
-
67
- AbstractValue &operator=(AbstractValue &&) noexcept = default;
68
-
69
- inline AbstractValueK getAbstractValueKind() const
70
- {
71
- return _kind;
72
- }
73
-
74
- virtual bool isTop() const = 0;
75
-
76
- virtual bool isBottom() const = 0;
77
- }; // end class AbstractValue
78
- } // end namespace SVF
79
- #endif //Z3_EXAMPLE_ABSTRACTVALUE_H
@@ -1,210 +0,0 @@
1
- //===- AddressValue.h ----Address Value Sets-------------------------//
2
- //
3
- // SVF: Static Value-Flow Analysis
4
- //
5
- // Copyright (C) <2013-2022> <Yulei Sui>
6
- //
7
-
8
- // This program is free software: you can redistribute it and/or modify
9
- // it under the terms of the GNU General Public License as published by
10
- // the Free Software Foundation, either version 3 of the License, or
11
- // (at your option) any later version.
12
-
13
- // This program is distributed in the hope that it will be useful,
14
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- // GNU General Public License for more details.
17
-
18
- // You should have received a copy of the GNU General Public License
19
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- //
21
- //===----------------------------------------------------------------------===//
22
- /*
23
- * AddressValue.h
24
- *
25
- * Created on: Jul 9, 2022
26
- * Author: Xiao Cheng
27
- *
28
- */
29
-
30
- #ifndef Z3_EXAMPLE_ADDRESSVALUE_H
31
- #define Z3_EXAMPLE_ADDRESSVALUE_H
32
-
33
- #define AddressMask 0x7f000000
34
- #define FlippedAddressMask (AddressMask^0xffffffff)
35
-
36
- #include "AbstractExecution/AbstractValue.h"
37
- #include "SVFIR/SVFIR.h"
38
-
39
- namespace SVF
40
- {
41
- class AddressValue : public AbstractValue
42
- {
43
- public:
44
- typedef Set<u32_t> AddrSet;
45
- private:
46
- AddrSet _addrs;
47
- public:
48
- /// Default constructor
49
- AddressValue() : AbstractValue(AddressK) {}
50
-
51
- /// Constructor
52
- AddressValue(const Set<u32_t> &addrs) : AbstractValue(AddressK), _addrs(addrs) {}
53
-
54
- AddressValue(u32_t addr) : AbstractValue(AddressK), _addrs({addr}) {}
55
-
56
- /// Default destructor
57
- ~AddressValue() = default;
58
-
59
- /// Copy constructor
60
- AddressValue(const AddressValue &other) : AbstractValue(AddressK), _addrs(other._addrs) {}
61
-
62
- /// Move constructor
63
- AddressValue(AddressValue &&other) noexcept: AbstractValue(AddressK), _addrs(std::move(other._addrs)) {}
64
-
65
- /// Copy operator=
66
- AddressValue &operator=(const AddressValue &other)
67
- {
68
- if (!this->equals(other))
69
- {
70
- _addrs = other._addrs;
71
- AbstractValue::operator=(other);
72
- }
73
- return *this;
74
- }
75
-
76
- /// Move operator=
77
- AddressValue &operator=(AddressValue &&other) noexcept
78
- {
79
- if (this != &other)
80
- {
81
- _addrs = std::move(other._addrs);
82
- AbstractValue::operator=(std::move(other));
83
- }
84
- return *this;
85
- }
86
-
87
- bool equals(const AddressValue &rhs) const
88
- {
89
- return _addrs == rhs._addrs;
90
- }
91
-
92
- bool operator==(const AddressValue &rhs) const
93
- {
94
- return _addrs == rhs._addrs;
95
- }
96
-
97
- /// Operator !=
98
- bool operator!=(const AddressValue &rhs) const
99
- {
100
- return _addrs != rhs._addrs;
101
- }
102
-
103
- AddrSet::const_iterator begin() const
104
- {
105
- return _addrs.cbegin();
106
- }
107
-
108
- AddrSet::const_iterator end() const
109
- {
110
- return _addrs.cend();
111
- }
112
-
113
- bool empty() const
114
- {
115
- return _addrs.empty();
116
- }
117
-
118
- u32_t size() const
119
- {
120
- return _addrs.size();
121
- }
122
-
123
- std::pair<AddressValue::AddrSet::iterator, bool> insert(u32_t id)
124
- {
125
- return _addrs.insert(id);
126
- }
127
-
128
- const AddrSet &getVals() const
129
- {
130
- return _addrs;
131
- }
132
-
133
- void setVals(const AddrSet &vals)
134
- {
135
- _addrs = vals;
136
- }
137
-
138
- /// Current AddressValue joins with another AddressValue
139
- void join_with(const AddressValue &other)
140
- {
141
- _addrs.insert(other.begin(), other.end());
142
- }
143
-
144
- /// Return a intersected AddressValue
145
- void meet_with(const AddressValue &other)
146
- {
147
- AddrSet s;
148
- for (const auto &id: other._addrs)
149
- {
150
- if (_addrs.find(id) != _addrs.end())
151
- {
152
- s.insert(id);
153
- }
154
- }
155
- _addrs = std::move(s);
156
- }
157
-
158
- /// Return true if the AddressValue contains n
159
- bool contains(u32_t id) const
160
- {
161
- return _addrs.count(id);
162
- }
163
-
164
- bool hasIntersect(const AddressValue &other)
165
- {
166
- AddressValue v = *this;
167
- v.meet_with(other);
168
- return !v.empty();
169
- }
170
-
171
- inline bool isTop() const override
172
- {
173
- return *this == getVirtualMemAddress(PAG::getPAG()->getBlackHoleObj()->getId());
174
- }
175
-
176
- inline bool isBottom() const override
177
- {
178
- return empty();
179
- }
180
-
181
- inline void setTop()
182
- {
183
- *this = getVirtualMemAddress(PAG::getPAG()->getBlackHoleObj()->getId());
184
- }
185
-
186
- inline void setBottom()
187
- {
188
- _addrs.clear();
189
- }
190
-
191
- /// The physical address starts with 0x7f...... + idx
192
- static inline u32_t getVirtualMemAddress(u32_t idx)
193
- {
194
- return AddressMask + idx;
195
- }
196
-
197
- /// Check bit value of val start with 0x7F000000, filter by 0xFF000000
198
- static inline bool isVirtualMemAddress(u32_t val)
199
- {
200
- return (val & 0xff000000) == AddressMask;
201
- }
202
-
203
- /// Return the internal index if idx is an address otherwise return the value of idx
204
- static inline u32_t getInternalID(u32_t idx)
205
- {
206
- return (idx & FlippedAddressMask);
207
- }
208
- };
209
- } // end namespace SVF
210
- #endif //Z3_EXAMPLE_ADDRESSVALUE_H
@@ -1,223 +0,0 @@
1
- //===- ExeState.h ----General Execution States-------------------------//
2
- //
3
- // SVF: Static Value-Flow Analysis
4
- //
5
- // Copyright (C) <2013-2022> <Yulei Sui>
6
- //
7
-
8
- // This program is free software: you can redistribute it and/or modify
9
- // it under the terms of the GNU General Public License as published by
10
- // the Free Software Foundation, either version 3 of the License, or
11
- // (at your option) any later version.
12
-
13
- // This program is distributed in the hope that it will be useful,
14
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- // GNU General Public License for more details.
17
-
18
- // You should have received a copy of the GNU General Public License
19
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- //
21
- //===----------------------------------------------------------------------===//
22
- /*
23
- * ExeState.h
24
- *
25
- * Created on: Aug 4, 2022
26
- * Author: Xiao Cheng
27
- *
28
- */
29
-
30
-
31
- #ifndef Z3_EXAMPLE_EXESTATE_H
32
- #define Z3_EXAMPLE_EXESTATE_H
33
-
34
- #include "AbstractExecution/AddressValue.h"
35
- #include "AbstractExecution/NumericLiteral.h"
36
- #include "Util/Z3Expr.h"
37
-
38
- namespace SVF
39
- {
40
-
41
- class IntervalExeState;
42
-
43
- /*!
44
- * Base execution state
45
- */
46
- class ExeState
47
- {
48
- friend class SVFIR2ItvExeState;
49
-
50
- public:
51
-
52
- typedef AddressValue VAddrs;
53
- typedef Map<u32_t, VAddrs> VarToVAddrs;
54
- /// Execution state kind
55
- enum ExeState_TYPE
56
- {
57
- IntervalK, ConcreteK
58
- };
59
- private:
60
- ExeState_TYPE _kind;
61
-
62
- public:
63
- ExeState(ExeState_TYPE kind) : _kind(kind) {}
64
-
65
- virtual ~ExeState() = default;
66
-
67
- ExeState(const ExeState &rhs) : _varToVAddrs(rhs._varToVAddrs),
68
- _locToVAddrs(rhs._locToVAddrs) {}
69
-
70
- ExeState(ExeState &&rhs) noexcept: _varToVAddrs(std::move(rhs._varToVAddrs)),
71
- _locToVAddrs(std::move(rhs._locToVAddrs)) {}
72
-
73
- ExeState &operator=(const ExeState &rhs)
74
- {
75
- if(*this != rhs)
76
- {
77
- _varToVAddrs = rhs._varToVAddrs;
78
- _locToVAddrs = rhs._locToVAddrs;
79
- }
80
- return *this;
81
- }
82
-
83
- ExeState &operator=(ExeState &&rhs) noexcept
84
- {
85
- if (this != &rhs)
86
- {
87
- _varToVAddrs = std::move(rhs._varToVAddrs);
88
- _locToVAddrs = std::move(rhs._locToVAddrs);
89
- }
90
- return *this;
91
- }
92
-
93
- bool operator==(const ExeState &rhs) const;
94
-
95
- inline bool operator!=(const ExeState &rhs) const
96
- {
97
- return !(*this == rhs);
98
- }
99
-
100
- bool equals(const ExeState *other) const
101
- {
102
- return false;
103
- }
104
-
105
- /// Make all value join with the other
106
- void joinWith(const ExeState &other);
107
-
108
- /// Make all value meet with the other
109
- void meetWith(const ExeState &other);
110
-
111
- virtual u32_t hash() const;
112
-
113
- /// Print values of all expressions
114
- virtual void printExprValues(std::ostream &oss) const {}
115
-
116
- virtual std::string toString() const
117
- {
118
- return "";
119
- }
120
-
121
- inline ExeState_TYPE getExeStateKind() const
122
- {
123
- return _kind;
124
- }
125
-
126
- inline virtual const VarToVAddrs &getVarToVAddrs() const
127
- {
128
- return _varToVAddrs;
129
- }
130
-
131
- inline virtual const VarToVAddrs &getLocToVAddrs() const
132
- {
133
- return _locToVAddrs;
134
- }
135
-
136
- inline virtual bool inVarToAddrsTable(u32_t id) const
137
- {
138
- return _varToVAddrs.find(id) != _varToVAddrs.end();
139
- }
140
-
141
- inline virtual bool inLocToAddrsTable(u32_t id) const
142
- {
143
- return _locToVAddrs.find(id) != _locToVAddrs.end();
144
- }
145
-
146
- virtual VAddrs &getVAddrs(u32_t id)
147
- {
148
- return _varToVAddrs[id];
149
- }
150
-
151
- inline virtual void storeVAddrs(u32_t addr, const VAddrs &vaddrs)
152
- {
153
- assert(isVirtualMemAddress(addr) && "not virtual address?");
154
- if(isNullPtr(addr)) return;
155
- u32_t objId = getInternalID(addr);
156
- _locToVAddrs[objId] = vaddrs;
157
- }
158
-
159
- inline virtual VAddrs &loadVAddrs(u32_t addr)
160
- {
161
- assert(isVirtualMemAddress(addr) && "not virtual address?");
162
- u32_t objId = getInternalID(addr);
163
- return _locToVAddrs[objId];
164
- }
165
-
166
- inline bool isNullPtr(u32_t addr)
167
- {
168
- return getInternalID(addr) == 0;
169
- }
170
-
171
- protected:
172
- VarToVAddrs _varToVAddrs{{0, getVirtualMemAddress(0)}};
173
- VarToVAddrs _locToVAddrs;
174
-
175
- protected:
176
-
177
- static bool eqVarToVAddrs(const VarToVAddrs &lhs, const VarToVAddrs &rhs)
178
- {
179
- if (lhs.size() != rhs.size()) return false;
180
- for (const auto &item: lhs)
181
- {
182
- auto it = rhs.find(item.first);
183
- if (it == rhs.end())
184
- return false;
185
- if (item.second != it->second)
186
- {
187
- return false;
188
- }
189
- }
190
- return true;
191
- }
192
-
193
- public:
194
- static z3::context &getContext()
195
- {
196
- return Z3Expr::getContext();
197
- }
198
-
199
- /// The physical address starts with 0x7f...... + idx
200
- static inline u32_t getVirtualMemAddress(u32_t idx)
201
- {
202
- return AddressValue::getVirtualMemAddress(idx);
203
- }
204
-
205
- /// Check bit value of val start with 0x7F000000, filter by 0xFF000000
206
- static inline bool isVirtualMemAddress(u32_t val)
207
- {
208
- return AddressValue::isVirtualMemAddress(val);
209
- }
210
-
211
- /// Return the internal index if idx is an address otherwise return the value of idx
212
- static inline u32_t getInternalID(u32_t idx)
213
- {
214
- return AddressValue::getInternalID(idx);
215
- }
216
-
217
-
218
- }; // end class ExeState
219
-
220
-
221
-
222
- } // end namespace SVF
223
- #endif //Z3_EXAMPLE_EXESTATE_H