svf-tools 1.0.639 → 1.0.641

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/README.md CHANGED
@@ -22,14 +22,14 @@
22
22
  ## Documentation
23
23
 
24
24
  <b>SVF</b> is a static value-flow analysis tool for LLVM-based languages. <b>SVF</b> ([CC'16](https://yuleisui.github.io/publications/cc16.pdf)) is able to perform
25
- * [WPA](https://github.com/SVF-tools/SVF/tree/master/include/WPA) (<b>whole program analysis</b>): field-sensitive ([SAS'19](https://yuleisui.github.io/publications/sas2019a.pdf)), flow-sensitive ([CGO'21](https://yuleisui.github.io/publications/cgo21.pdf), [OOPSLA'21](https://yuleisui.github.io/publications/oopsla21.pdf)) analysis;
26
- * [DDA](https://github.com/SVF-tools/SVF/tree/master/include/DDA) (<b>demand-driven analysis</b>): flow-sensitive, context-sensitive points-to analysis ([FSE'16](https://yuleisui.github.io/publications/fse16.pdf), [TSE'18](https://yuleisui.github.io/publications/tse18.pdf));
27
- * [MSSA](https://github.com/SVF-tools/SVF/tree/master/include/MSSA) (<b>memory SSA form construction</b>): memory regions, side-effects, SSA form ([JSS'18](https://yuleisui.github.io/publications/jss18.pdf));
28
- * [SABER](https://github.com/SVF-tools/SVF/tree/master/include/SABER) (<b>memory error checking</b>): memory leaks and double-frees ([ISSTA'12](https://yuleisui.github.io/publications/issta12.pdf), [TSE'14](https://yuleisui.github.io/publications/tse14.pdf), [ICSE'18](https://yuleisui.github.io/publications/icse18a.pdf));
29
- * [MTA](https://github.com/SVF-tools/SVF/tree/master/include/MTA) (<b>analysis of mutithreaded programs</b>): value-flows for multithreaded programs ([CGO'16](https://yuleisui.github.io/publications/cgo16.pdf));
30
- * [CFL](https://github.com/SVF-tools/SVF/tree/master/include/CFL) (<b>context-free-reachability analysis</b>): standard CFL solver, graph and grammar ([OOPSLA'22](https://yuleisui.github.io/publications/oopsla22.pdf));
31
- * [SVFIR](https://github.com/SVF-tools/SVF/tree/master/include/SVFIR) and [MemoryModel](https://github.com/SVF-tools/SVF/tree/master/include/MemoryModel) (<b>SVFIR</b>): SVFIR, memory abstraction and points-to data structure ([SAS'21](https://yuleisui.github.io/publications/sas21.pdf));
32
- * [Graphs](https://github.com/SVF-tools/SVF/tree/master/include/Graphs): <b> generating a variety of graphs</b>, including call graph, ICFG, class hirachary graph, constraint graph, value-flow graph for static analyses and code embedding ([OOPSLA'20](https://yuleisui.github.io/publications/oopsla20.pdf), [TOSEM'21](https://yuleisui.github.io/publications/tosem21.pdf))
25
+ * [WPA](https://github.com/SVF-tools/SVF/tree/master/svf/include/WPA) (<b>whole program analysis</b>): field-sensitive ([SAS'19](https://yuleisui.github.io/publications/sas2019a.pdf)), flow-sensitive ([CGO'21](https://yuleisui.github.io/publications/cgo21.pdf), [OOPSLA'21](https://yuleisui.github.io/publications/oopsla21.pdf)) analysis;
26
+ * [DDA](https://github.com/SVF-tools/SVF/tree/master/svf/include/DDA) (<b>demand-driven analysis</b>): flow-sensitive, context-sensitive points-to analysis ([FSE'16](https://yuleisui.github.io/publications/fse16.pdf), [TSE'18](https://yuleisui.github.io/publications/tse18.pdf));
27
+ * [MSSA](https://github.com/SVF-tools/SVF/tree/master/svf/include/MSSA) (<b>memory SSA form construction</b>): memory regions, side-effects, SSA form ([JSS'18](https://yuleisui.github.io/publications/jss18.pdf));
28
+ * [SABER](https://github.com/SVF-tools/SVF/tree/master/svf/include/SABER) (<b>memory error checking</b>): memory leaks and double-frees ([ISSTA'12](https://yuleisui.github.io/publications/issta12.pdf), [TSE'14](https://yuleisui.github.io/publications/tse14.pdf), [ICSE'18](https://yuleisui.github.io/publications/icse18a.pdf));
29
+ * [MTA](https://github.com/SVF-tools/SVF/tree/master/svf/include/MTA) (<b>analysis of mutithreaded programs</b>): value-flows for multithreaded programs ([CGO'16](https://yuleisui.github.io/publications/cgo16.pdf));
30
+ * [CFL](https://github.com/SVF-tools/SVF/tree/master/svf/include/CFL) (<b>context-free-reachability analysis</b>): standard CFL solver, graph and grammar ([OOPSLA'22](https://yuleisui.github.io/publications/oopsla22.pdf));
31
+ * [SVFIR](https://github.com/SVF-tools/SVF/tree/master/svf/include/SVFIR) and [MemoryModel](https://github.com/SVF-tools/SVF/tree/master/svf/include/MemoryModel) (<b>SVFIR</b>): SVFIR, memory abstraction and points-to data structure ([SAS'21](https://yuleisui.github.io/publications/sas21.pdf));
32
+ * [Graphs](https://github.com/SVF-tools/SVF/tree/master/svf/include/Graphs): <b> generating a variety of graphs</b>, including call graph, ICFG, class hirachary graph, constraint graph, value-flow graph for static analyses and code embedding ([OOPSLA'20](https://yuleisui.github.io/publications/oopsla20.pdf), [TOSEM'21](https://yuleisui.github.io/publications/tosem21.pdf))
33
33
 
34
34
  <b>SVF</b>'s doxygen document is available [here](https://svf-tools.github.io/SVF-doxygen/html).
35
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.639",
3
+ "version": "1.0.641",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -212,6 +212,12 @@ public:
212
212
  }
213
213
  }
214
214
 
215
+ /// domain widen with other, and return the widened domain
216
+ IntervalExeState widening(const IntervalExeState &other);
217
+
218
+ /// domain narrow with other, and return the narrowed domain
219
+ IntervalExeState narrowing(const IntervalExeState &other);
220
+
215
221
  /// domain widen with other, important! other widen this.
216
222
  void widenWith(const IntervalExeState &other);
217
223
 
@@ -252,6 +258,13 @@ public:
252
258
  return true;
253
259
  }
254
260
  }
261
+ for (auto it = _locToItvVal.begin(); it != _locToItvVal.end(); ++it)
262
+ {
263
+ if (it->second.isBottom())
264
+ {
265
+ return true;
266
+ }
267
+ }
255
268
  return false;
256
269
  }
257
270
 
@@ -357,13 +370,9 @@ public:
357
370
 
358
371
  static bool lessThanVarToValMap(const VarToValMap &lhs, const VarToValMap &rhs)
359
372
  {
360
- if (lhs.size() != rhs.size()) return lhs.size() < rhs.size();
361
373
  for (const auto &item: lhs)
362
374
  {
363
375
  auto it = rhs.find(item.first);
364
- // lhs > rhs if SVFVar not exists in rhs
365
- if (it == rhs.end())
366
- return false;
367
376
  // judge from expr id
368
377
  if (!item.second.equals(it->second))
369
378
  {
@@ -377,7 +377,7 @@ public:
377
377
  }
378
378
  else
379
379
  {
380
- this->_lb = !lb().leq(other.lb()) ? minus_infinity() : this->lb();
380
+ this->_lb = !lb().geq(other.lb()) ? minus_infinity() : this->lb();
381
381
  this->_ub = !ub().geq(other.ub()) ? plus_infinity() : this->ub();
382
382
  }
383
383
  }
@@ -395,8 +395,8 @@ public:
395
395
  }
396
396
  else
397
397
  {
398
- this->_lb = is_infinite(this->_lb) ? other._lb : this->_lb;
399
- this->_ub = is_infinite(this->_ub) ? other._ub : this->_ub;
398
+ this->_lb = is_infinite(this->lb()) ? other._lb : this->_lb;
399
+ this->_ub = is_infinite(this->ub()) ? other._ub : this->_ub;
400
400
  }
401
401
  }
402
402
 
@@ -56,6 +56,43 @@ u32_t IntervalExeState::hash() const
56
56
  return pairH(std::make_pair(std::make_pair(h, h2), (u32_t) ExeState::hash()));
57
57
  }
58
58
 
59
+ IntervalExeState IntervalExeState::widening(const IntervalExeState& other)
60
+ {
61
+ IntervalExeState es = *this;
62
+ for (auto it = es._varToItvVal.begin(); it != es._varToItvVal.end(); ++it)
63
+ {
64
+ auto key = it->first;
65
+ if (other._varToItvVal.find(key) != other._varToItvVal.end())
66
+ it->second.widen_with(other._varToItvVal.at(key));
67
+ }
68
+ for (auto it = es._locToItvVal.begin(); it != es._locToItvVal.end(); ++it)
69
+ {
70
+ auto key = it->first;
71
+ if (other._locToItvVal.find(key) != other._locToItvVal.end())
72
+ it->second.widen_with(other._locToItvVal.at(key));
73
+ }
74
+ return es;
75
+ }
76
+
77
+ IntervalExeState IntervalExeState::narrowing(const IntervalExeState& other)
78
+ {
79
+ IntervalExeState es = *this;
80
+ for (auto it = es._varToItvVal.begin(); it != es._varToItvVal.end(); ++it)
81
+ {
82
+ auto key = it->first;
83
+ if (other._varToItvVal.find(key) != other._varToItvVal.end())
84
+ it->second.narrow_with(other._varToItvVal.at(key));
85
+ }
86
+ for (auto it = es._locToItvVal.begin(); it != es._locToItvVal.end(); ++it)
87
+ {
88
+ auto key = it->first;
89
+ if (other._locToItvVal.find(key) != other._locToItvVal.end())
90
+ it->second.narrow_with(other._locToItvVal.at(key));
91
+ }
92
+ return es;
93
+
94
+ }
95
+
59
96
  /// domain widen with other, important! other widen this.
60
97
  void IntervalExeState::widenWith(const IntervalExeState& other)
61
98
  {
@@ -63,21 +100,13 @@ void IntervalExeState::widenWith(const IntervalExeState& other)
63
100
  {
64
101
  auto key = it->first;
65
102
  if (other.getVarToVal().find(key) != other.getVarToVal().end())
66
- {
67
- auto lhs = other.getVarToVal().at(key);
68
- lhs.widen_with(it->second);
69
- it->second = lhs;
70
- }
103
+ it->second.widen_with(other._varToItvVal.at(key));
71
104
  }
72
105
  for (auto it = _locToItvVal.begin(); it != _locToItvVal.end(); ++it)
73
106
  {
74
107
  auto key = it->first;
75
108
  if (other._locToItvVal.find(key) != other._locToItvVal.end())
76
- {
77
- auto lhs = other._locToItvVal.at(key);
78
- lhs.widen_with(it->second);
79
- it->second = lhs;
80
- }
109
+ it->second.widen_with(other._locToItvVal.at(key));
81
110
  }
82
111
  }
83
112
 
@@ -89,7 +118,7 @@ void IntervalExeState::joinWith(const IntervalExeState& other)
89
118
  {
90
119
  auto key = it->first;
91
120
  auto oit = _varToItvVal.find(key);
92
- if (oit != other._varToItvVal.end())
121
+ if (oit != _varToItvVal.end())
93
122
  {
94
123
  oit->second.join_with(it->second);
95
124
  }
@@ -102,7 +131,7 @@ void IntervalExeState::joinWith(const IntervalExeState& other)
102
131
  {
103
132
  auto key = it->first;
104
133
  auto oit = _locToItvVal.find(key);
105
- if (oit != other._locToItvVal.end())
134
+ if (oit != _locToItvVal.end())
106
135
  {
107
136
  oit->second.join_with(it->second);
108
137
  }
@@ -121,18 +150,14 @@ void IntervalExeState::narrowWith(const IntervalExeState& other)
121
150
  auto key = it->first;
122
151
  auto oit = other.getVarToVal().find(key);
123
152
  if (oit != other.getVarToVal().end())
124
- {
125
153
  it->second.narrow_with(oit->second);
126
- }
127
154
  }
128
155
  for (auto it = _locToItvVal.begin(); it != _locToItvVal.end(); ++it)
129
156
  {
130
157
  auto key = it->first;
131
158
  auto oit = other._locToItvVal.find(key);
132
159
  if (oit != other._locToItvVal.end())
133
- {
134
160
  it->second.narrow_with(oit->second);
135
- }
136
161
  }
137
162
  }
138
163