svf-lib 1.0.992 → 1.0.993
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.
- package/SVF-linux/Release-build/lib/libSvf.a +0 -0
- package/SVF-linux/include/CFL/CFGNormalizer.h +6 -3
- package/SVF-linux/include/CFL/CFLAlias.h +26 -15
- package/SVF-linux/include/CFL/CFLGrammar.h +30 -16
- package/SVF-linux/include/CFL/CFLSolver.h +9 -5
- package/SVF-linux/include/CFL/GrammarBuilder.h +10 -7
- package/SVF-linux/include/CUDD/cudd.h +20 -11
- package/SVF-linux/include/CUDD/cuddInt.h +48 -31
- package/SVF-linux/include/CUDD/epd.h +35 -29
- package/SVF-linux/include/CUDD/mtr.h +4 -3
- package/SVF-linux/include/CUDD/st.h +7 -4
- package/SVF-linux/include/CUDD/util.h +6 -6
- package/SVF-linux/include/FastCluster/fastcluster.h +13 -12
- package/SVF-linux/include/Graphs/CFLGraph.h +16 -10
- package/SVF-linux/include/Graphs/CHG.h +2 -2
- package/SVF-linux/include/Graphs/ConsG.h +2 -1
- package/SVF-linux/include/Graphs/GenericGraph.h +3 -3
- package/SVF-linux/include/Graphs/ICFG.h +2 -2
- package/SVF-linux/include/Graphs/ICFGEdge.h +16 -9
- package/SVF-linux/include/Graphs/ICFGNode.h +2 -2
- package/SVF-linux/include/Graphs/IRGraph.h +10 -6
- package/SVF-linux/include/Graphs/PTACallGraph.h +1 -1
- package/SVF-linux/include/Graphs/SVFG.h +4 -3
- package/SVF-linux/include/Graphs/SVFGNode.h +14 -8
- package/SVF-linux/include/Graphs/ThreadCallGraph.h +4 -2
- package/SVF-linux/include/Graphs/VFG.h +45 -39
- package/SVF-linux/include/Graphs/VFGNode.h +8 -4
- package/SVF-linux/include/MSSA/MemSSA.h +1 -1
- package/SVF-linux/include/MTA/FSMPTA.h +55 -44
- package/SVF-linux/include/MTA/LockAnalysis.h +11 -9
- package/SVF-linux/include/MTA/LockResultValidator.h +64 -54
- package/SVF-linux/include/MTA/MHP.h +17 -13
- package/SVF-linux/include/MTA/MTAResultValidator.h +24 -20
- package/SVF-linux/include/MTA/PCG.h +9 -7
- package/SVF-linux/include/MTA/TCT.h +27 -22
- package/SVF-linux/include/MemoryModel/LocationSet.h +5 -3
- package/SVF-linux/include/MemoryModel/PersistentPointsToCache.h +28 -13
- package/SVF-linux/include/MemoryModel/PersistentPointsToDS.h +2 -2
- package/SVF-linux/include/MemoryModel/PointerAnalysis.h +5 -4
- package/SVF-linux/include/MemoryModel/PointsTo.h +8 -2
- package/SVF-linux/include/MemoryModel/SVFIR.h +6 -5
- package/SVF-linux/include/MemoryModel/SVFStatements.h +65 -45
- package/SVF-linux/include/MemoryModel/SVFVariables.h +6 -5
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +18 -15
- package/SVF-linux/include/SABER/PathCondAllocator.h +14 -7
- package/SVF-linux/include/SABER/ProgSlice.h +2 -1
- package/SVF-linux/include/SABER/SaberSVFGBuilder.h +1 -1
- package/SVF-linux/include/SABER/SrcSnkDDA.h +8 -4
- package/SVF-linux/include/SVF-FE/CHGBuilder.h +4 -2
- package/SVF-linux/include/SVF-FE/DataFlowUtil.h +10 -9
- package/SVF-linux/include/SVF-FE/IRAnnotator.h +8 -8
- package/SVF-linux/include/SVF-FE/LLVMModule.h +13 -12
- package/SVF-linux/include/SVF-FE/LLVMUtil.h +4 -4
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +13 -9
- package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +3 -2
- package/SVF-linux/include/Util/BDDExpr.h +32 -16
- package/SVF-linux/include/Util/BasicTypes.h +77 -25
- package/SVF-linux/include/Util/CoreBitVector.h +2 -1
- package/SVF-linux/include/Util/CxtStmt.h +37 -27
- package/SVF-linux/include/Util/ExeState.h +42 -22
- package/SVF-linux/include/Util/ExtAPI.h +1 -1
- package/SVF-linux/include/Util/NodeIDAllocator.h +7 -4
- package/SVF-linux/include/Util/Options.h +3 -3
- package/SVF-linux/include/Util/SVFBasicTypes.h +49 -40
- package/SVF-linux/include/Util/SVFModule.h +5 -5
- package/SVF-linux/include/Util/SVFUtil.h +12 -9
- package/SVF-linux/include/Util/Z3Expr.h +191 -144
- package/SVF-linux/include/WPA/Andersen.h +11 -11
- package/SVF-linux/include/WPA/VersionedFlowSensitive.h +4 -1
- package/package.json +1 -1
|
@@ -32,202 +32,249 @@
|
|
|
32
32
|
#include "z3++.h"
|
|
33
33
|
#include "Util/SVFBasicTypes.h"
|
|
34
34
|
|
|
35
|
-
namespace SVF
|
|
35
|
+
namespace SVF
|
|
36
|
+
{
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
class Z3Expr
|
|
39
|
+
{
|
|
40
|
+
public:
|
|
41
|
+
static z3::context *ctx;
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
private:
|
|
44
|
+
z3::expr e;
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
Z3Expr(float f); // placeholder don't support floating point expression
|
|
47
|
+
Z3Expr(double f); // placeholder don't support floating point expression
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
public:
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
Z3Expr() : e(nullExpr())
|
|
52
|
+
{
|
|
53
|
+
}
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
Z3Expr(const z3::expr &_e) : e(_e)
|
|
56
|
+
{
|
|
57
|
+
}
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
Z3Expr(int i) : e(getContext().int_val(i))
|
|
60
|
+
{
|
|
61
|
+
}
|
|
57
62
|
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
Z3Expr(const Z3Expr &z3Expr) : e(z3Expr.getExpr())
|
|
64
|
+
{
|
|
65
|
+
}
|
|
60
66
|
|
|
61
|
-
|
|
67
|
+
virtual ~Z3Expr() = default;
|
|
62
68
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
inline Z3Expr &operator=(const Z3Expr &rhs)
|
|
70
|
+
{
|
|
71
|
+
if (this->id() != rhs.id())
|
|
72
|
+
{
|
|
73
|
+
e = rhs.getExpr();
|
|
68
74
|
}
|
|
75
|
+
return *this;
|
|
76
|
+
}
|
|
69
77
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
const z3::expr &getExpr() const
|
|
79
|
+
{
|
|
80
|
+
return e;
|
|
81
|
+
}
|
|
73
82
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
/// Get z3 context, singleton design here to make sure we only have one context
|
|
84
|
+
static z3::context &getContext()
|
|
85
|
+
{
|
|
86
|
+
if (ctx == nullptr)
|
|
87
|
+
{
|
|
88
|
+
ctx = new z3::context();
|
|
80
89
|
}
|
|
90
|
+
return *ctx;
|
|
91
|
+
}
|
|
81
92
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
93
|
+
/// release z3 context
|
|
94
|
+
static void releaseContext()
|
|
95
|
+
{
|
|
96
|
+
delete ctx;
|
|
97
|
+
ctx = nullptr;
|
|
98
|
+
}
|
|
87
99
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
100
|
+
/// null expression
|
|
101
|
+
static z3::expr nullExpr()
|
|
102
|
+
{
|
|
103
|
+
return getContext().int_const("null");
|
|
104
|
+
}
|
|
92
105
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
106
|
+
/// get id
|
|
107
|
+
inline u32_t id() const
|
|
108
|
+
{
|
|
109
|
+
return e.id();
|
|
110
|
+
}
|
|
97
111
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
112
|
+
inline const std::string to_string() const
|
|
113
|
+
{
|
|
114
|
+
return e.to_string();
|
|
115
|
+
}
|
|
101
116
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
117
|
+
inline bool is_numeral() const
|
|
118
|
+
{
|
|
119
|
+
return e.is_numeral();
|
|
120
|
+
}
|
|
105
121
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
122
|
+
inline bool is_bool() const
|
|
123
|
+
{
|
|
124
|
+
return e.is_bool();
|
|
125
|
+
}
|
|
109
126
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
127
|
+
inline Z3Expr simplify() const
|
|
128
|
+
{
|
|
129
|
+
return e.simplify();
|
|
130
|
+
}
|
|
113
131
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
132
|
+
inline int64_t get_numeral_int64() const
|
|
133
|
+
{
|
|
134
|
+
return e.get_numeral_int64();
|
|
135
|
+
}
|
|
117
136
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
137
|
+
inline int get_numeral_int() const
|
|
138
|
+
{
|
|
139
|
+
return e.get_numeral_int();
|
|
140
|
+
}
|
|
121
141
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
142
|
+
//{% reload operator
|
|
143
|
+
friend Z3Expr operator==(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
144
|
+
{
|
|
145
|
+
return lhs.getExpr() == rhs.getExpr();
|
|
146
|
+
}
|
|
126
147
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
148
|
+
friend Z3Expr operator!=(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
149
|
+
{
|
|
150
|
+
return lhs.getExpr() != rhs.getExpr();
|
|
151
|
+
}
|
|
130
152
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
153
|
+
friend Z3Expr operator>(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
154
|
+
{
|
|
155
|
+
return lhs.getExpr() > rhs.getExpr();
|
|
156
|
+
}
|
|
134
157
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
158
|
+
friend Z3Expr operator<(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
159
|
+
{
|
|
160
|
+
return lhs.getExpr() < rhs.getExpr();
|
|
161
|
+
}
|
|
138
162
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
163
|
+
friend Z3Expr operator<=(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
164
|
+
{
|
|
165
|
+
return lhs.getExpr() <= rhs.getExpr();
|
|
166
|
+
}
|
|
142
167
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
168
|
+
friend Z3Expr operator>=(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
169
|
+
{
|
|
170
|
+
return lhs.getExpr() >= rhs.getExpr();
|
|
171
|
+
}
|
|
146
172
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
173
|
+
friend Z3Expr operator+(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
174
|
+
{
|
|
175
|
+
return lhs.getExpr() + rhs.getExpr();
|
|
176
|
+
}
|
|
150
177
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
178
|
+
friend Z3Expr operator-(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
179
|
+
{
|
|
180
|
+
return lhs.getExpr() - rhs.getExpr();
|
|
181
|
+
}
|
|
154
182
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
183
|
+
friend Z3Expr operator*(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
184
|
+
{
|
|
185
|
+
return lhs.getExpr() * rhs.getExpr();
|
|
186
|
+
}
|
|
158
187
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
188
|
+
friend Z3Expr operator/(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
189
|
+
{
|
|
190
|
+
return lhs.getExpr() / rhs.getExpr();
|
|
191
|
+
}
|
|
162
192
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
193
|
+
friend Z3Expr operator%(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
194
|
+
{
|
|
195
|
+
return lhs.getExpr() % rhs.getExpr();
|
|
196
|
+
}
|
|
166
197
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
198
|
+
friend Z3Expr operator^(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
199
|
+
{
|
|
200
|
+
return lhs.getExpr() ^ rhs.getExpr();
|
|
201
|
+
}
|
|
170
202
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
203
|
+
friend Z3Expr operator&(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
204
|
+
{
|
|
205
|
+
return lhs.getExpr() & rhs.getExpr();
|
|
206
|
+
}
|
|
174
207
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
208
|
+
friend Z3Expr operator|(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
209
|
+
{
|
|
210
|
+
return lhs.getExpr() | rhs.getExpr();
|
|
211
|
+
}
|
|
178
212
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
213
|
+
friend Z3Expr ashr(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
214
|
+
{
|
|
215
|
+
return ashr(lhs.getExpr(), rhs.getExpr());
|
|
216
|
+
}
|
|
182
217
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
218
|
+
friend Z3Expr shl(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
219
|
+
{
|
|
220
|
+
return shl(lhs.getExpr(), rhs.getExpr());
|
|
221
|
+
}
|
|
186
222
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
223
|
+
friend Z3Expr int2bv(u32_t n, const Z3Expr &e)
|
|
224
|
+
{
|
|
225
|
+
return int2bv(n, e.getExpr());
|
|
226
|
+
}
|
|
190
227
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
228
|
+
friend Z3Expr bv2int(const Z3Expr &e, bool isSigned)
|
|
229
|
+
{
|
|
230
|
+
return z3::bv2int(e.getExpr(), isSigned);
|
|
231
|
+
}
|
|
194
232
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
233
|
+
friend Z3Expr operator&&(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
234
|
+
{
|
|
235
|
+
return lhs.getExpr() && rhs.getExpr();
|
|
236
|
+
}
|
|
198
237
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
238
|
+
friend Z3Expr operator||(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
239
|
+
{
|
|
240
|
+
return lhs.getExpr() || rhs.getExpr();
|
|
241
|
+
}
|
|
202
242
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
243
|
+
friend Z3Expr operator!(const Z3Expr &lhs)
|
|
244
|
+
{
|
|
245
|
+
return !lhs.getExpr();
|
|
246
|
+
}
|
|
206
247
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
248
|
+
friend Z3Expr ite(const Z3Expr& cond, const Z3Expr& lhs, const Z3Expr& rhs)
|
|
249
|
+
{
|
|
250
|
+
return ite(cond.getExpr(), lhs.getExpr(), rhs.getExpr());
|
|
251
|
+
}
|
|
210
252
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
253
|
+
friend std::ostream &operator<<(std::ostream &out, const Z3Expr &expr)
|
|
254
|
+
{
|
|
255
|
+
out << expr.getExpr();
|
|
256
|
+
return out;
|
|
257
|
+
}
|
|
215
258
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
259
|
+
friend bool eq(const Z3Expr &lhs, const Z3Expr &rhs)
|
|
260
|
+
{
|
|
261
|
+
return eq(lhs.getExpr(), rhs.getExpr());
|
|
262
|
+
}
|
|
219
263
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
264
|
+
z3::sort get_sort() const
|
|
265
|
+
{
|
|
266
|
+
return getExpr().get_sort();
|
|
267
|
+
}
|
|
268
|
+
//%}
|
|
269
|
+
};
|
|
225
270
|
}
|
|
226
271
|
|
|
227
272
|
/// Specialise hash for AbsCxtDPItem.
|
|
228
273
|
template<>
|
|
229
|
-
struct std::hash<SVF::Z3Expr>
|
|
230
|
-
|
|
274
|
+
struct std::hash<SVF::Z3Expr>
|
|
275
|
+
{
|
|
276
|
+
size_t operator()(const SVF::Z3Expr &z3Expr) const
|
|
277
|
+
{
|
|
231
278
|
return z3Expr.id();
|
|
232
279
|
}
|
|
233
280
|
};
|
|
@@ -85,16 +85,16 @@ public:
|
|
|
85
85
|
static inline bool classof(const PointerAnalysis *pta)
|
|
86
86
|
{
|
|
87
87
|
return ( pta->getAnalysisTy() == Andersen_BASE
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
|| pta->getAnalysisTy() == Andersen_WPA
|
|
89
|
+
|| pta->getAnalysisTy() == AndersenLCD_WPA
|
|
90
|
+
|| pta->getAnalysisTy() == AndersenHCD_WPA
|
|
91
|
+
|| pta->getAnalysisTy() == AndersenHLCD_WPA
|
|
92
|
+
|| pta->getAnalysisTy() == AndersenWaveDiff_WPA
|
|
93
|
+
|| pta->getAnalysisTy() == AndersenWaveDiffWithType_WPA
|
|
94
|
+
|| pta->getAnalysisTy() == AndersenSCD_WPA
|
|
95
|
+
|| pta->getAnalysisTy() == AndersenSFR_WPA
|
|
96
|
+
|| pta->getAnalysisTy() == TypeCPP_WPA
|
|
97
|
+
|| pta->getAnalysisTy() == Steensgaard_WPA);
|
|
98
98
|
}
|
|
99
99
|
//@}
|
|
100
100
|
|
|
@@ -190,7 +190,7 @@ public:
|
|
|
190
190
|
static inline bool classof(const PointerAnalysis *pta)
|
|
191
191
|
{
|
|
192
192
|
return (pta->getAnalysisTy() == Andersen_WPA
|
|
193
|
-
|
|
193
|
+
|| pta->getAnalysisTy() == AndersenLCD_WPA
|
|
194
194
|
|| pta->getAnalysisTy() == AndersenHCD_WPA
|
|
195
195
|
|| pta->getAnalysisTy() == AndersenHLCD_WPA
|
|
196
196
|
|| pta->getAnalysisTy() == AndersenWaveDiff_WPA
|
|
@@ -99,7 +99,10 @@ protected:
|
|
|
99
99
|
virtual void updateConnectedNodes(const SVFGEdgeSetTy& newEdges) override;
|
|
100
100
|
|
|
101
101
|
/// Override to do nothing. Instead, we will use propagateVersion when necessary.
|
|
102
|
-
virtual bool propAlongIndirectEdge(const IndirectSVFGEdge*) override
|
|
102
|
+
virtual bool propAlongIndirectEdge(const IndirectSVFGEdge*) override
|
|
103
|
+
{
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
103
106
|
|
|
104
107
|
/// Override since we want to assign different weights based on versioning.
|
|
105
108
|
virtual void cluster(void) override;
|