svf-tools 1.0.1073 → 1.0.1074

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 (129) hide show
  1. package/build.sh +0 -0
  2. package/package.json +1 -1
  3. package/svf/include/AE/Core/ICFGWTO.h +53 -0
  4. package/svf/include/AE/Svfexe/AbsExtAPI.h +0 -2
  5. package/svf/include/AE/Svfexe/AbstractInterpretation.h +31 -4
  6. package/svf/include/Util/Options.h +3 -0
  7. package/svf/lib/AE/Svfexe/AbsExtAPI.cpp +2 -0
  8. package/svf/lib/AE/Svfexe/AbstractInterpretation.cpp +216 -71
  9. package/svf/lib/Util/Options.cpp +13 -0
  10. package/svf-llvm/tools/AE/ae.cpp +1 -0
  11. package/SVF-doxygen/doxygen.config +0 -2548
  12. package/SVF-doxygen/wiki/PAG.png +0 -0
  13. package/SVF-doxygen/wiki/andersen.png +0 -0
  14. package/SVF-doxygen/wiki/callgraph.png +0 -0
  15. package/SVF-doxygen/wiki/consG.png +0 -0
  16. package/SVF-doxygen/wiki/cpu2000-flto +0 -432
  17. package/SVF-doxygen/wiki/cpu2006-flto +0 -417
  18. package/SVF-doxygen/wiki/cpu2017-wllvm.cfg +0 -999
  19. package/SVF-doxygen/wiki/database.png +0 -0
  20. package/SVF-doxygen/wiki/framework.png +0 -0
  21. package/SVF-doxygen/wiki/help.png +0 -0
  22. package/SVF-doxygen/wiki/icfg.png +0 -0
  23. package/SVF-doxygen/wiki/mssa-cha.png +0 -0
  24. package/SVF-doxygen/wiki/pagedge.png +0 -0
  25. package/SVF-doxygen/wiki/pagnode.png +0 -0
  26. package/SVF-doxygen/wiki/pt.png +0 -0
  27. package/SVF-doxygen/wiki/setupcmake.png +0 -0
  28. package/SVF-doxygen/wiki/setupconfiguration.png +0 -0
  29. package/SVF-doxygen/wiki/setupdashboard.png +0 -0
  30. package/SVF-doxygen/wiki/setupdebug.png +0 -0
  31. package/SVF-doxygen/wiki/setupenv.png +0 -0
  32. package/SVF-doxygen/wiki/startup.png +0 -0
  33. package/SVF-doxygen/wiki/svf-stat.pdf +0 -0
  34. package/SVF-doxygen/wiki/svfg-framework.png +0 -0
  35. package/SVF-doxygen/wiki/svfg.png +0 -0
  36. package/SVF-doxygen/wiki/svfg_opt.png +0 -0
  37. package/SVF-doxygen/wiki/svfgedge-cha.png +0 -0
  38. package/SVF-doxygen/wiki/svfgnode-cha.png +0 -0
  39. package/SVF-doxygen/wiki/svfpic/README.md +0 -6
  40. package/SVF-doxygen/wiki/svfpic/ass-1debug1.png +0 -0
  41. package/SVF-doxygen/wiki/svfpic/ass-1debug2.png +0 -0
  42. package/SVF-doxygen/wiki/svfpic/build.jpg +0 -0
  43. package/SVF-doxygen/wiki/svfpic/cmd.png +0 -0
  44. package/SVF-doxygen/wiki/svfpic/connect1.jpg +0 -0
  45. package/SVF-doxygen/wiki/svfpic/connect2.png +0 -0
  46. package/SVF-doxygen/wiki/svfpic/connect3.png +0 -0
  47. package/SVF-doxygen/wiki/svfpic/connect4.jpg +0 -0
  48. package/SVF-doxygen/wiki/svfpic/connect5.jpg +0 -0
  49. package/SVF-doxygen/wiki/svfpic/connect6.png +0 -0
  50. package/SVF-doxygen/wiki/svfpic/connect7.jpg +0 -0
  51. package/SVF-doxygen/wiki/svfpic/continue.png +0 -0
  52. package/SVF-doxygen/wiki/svfpic/debug-new.png +0 -0
  53. package/SVF-doxygen/wiki/svfpic/debug-new2.png +0 -0
  54. package/SVF-doxygen/wiki/svfpic/debug1.jpeg +0 -0
  55. package/SVF-doxygen/wiki/svfpic/debug2.jpeg +0 -0
  56. package/SVF-doxygen/wiki/svfpic/debug3.png +0 -0
  57. package/SVF-doxygen/wiki/svfpic/debug4.png +0 -0
  58. package/SVF-doxygen/wiki/svfpic/debug5.jpeg +0 -0
  59. package/SVF-doxygen/wiki/svfpic/debug6.jpeg +0 -0
  60. package/SVF-doxygen/wiki/svfpic/docker_sys_requirement.png +0 -0
  61. package/SVF-doxygen/wiki/svfpic/docker_sys_requirements.png +0 -0
  62. package/SVF-doxygen/wiki/svfpic/dockerbuild.png +0 -0
  63. package/SVF-doxygen/wiki/svfpic/dockerbuild2.jpg +0 -0
  64. package/SVF-doxygen/wiki/svfpic/dockerbuild3.jpg +0 -0
  65. package/SVF-doxygen/wiki/svfpic/dockerbuild4.png +0 -0
  66. package/SVF-doxygen/wiki/svfpic/dockerbuild5.jpg +0 -0
  67. package/SVF-doxygen/wiki/svfpic/dockerbuildimage.png +0 -0
  68. package/SVF-doxygen/wiki/svfpic/dockercmd.png +0 -0
  69. package/SVF-doxygen/wiki/svfpic/dockercmd2.png +0 -0
  70. package/SVF-doxygen/wiki/svfpic/dockercontainer.png +0 -0
  71. package/SVF-doxygen/wiki/svfpic/dockerdb1.jpg +0 -0
  72. package/SVF-doxygen/wiki/svfpic/dockerdb10.jpeg +0 -0
  73. package/SVF-doxygen/wiki/svfpic/dockerdb2.jpg +0 -0
  74. package/SVF-doxygen/wiki/svfpic/dockerdb3.jpg +0 -0
  75. package/SVF-doxygen/wiki/svfpic/dockerdb4.jpg +0 -0
  76. package/SVF-doxygen/wiki/svfpic/dockerdb5.png +0 -0
  77. package/SVF-doxygen/wiki/svfpic/dockerdb6.jpeg +0 -0
  78. package/SVF-doxygen/wiki/svfpic/dockerdb7.png +0 -0
  79. package/SVF-doxygen/wiki/svfpic/dockerdb8.png +0 -0
  80. package/SVF-doxygen/wiki/svfpic/dockerdb9.jpeg +0 -0
  81. package/SVF-doxygen/wiki/svfpic/dockerfinshbuilt.png +0 -0
  82. package/SVF-doxygen/wiki/svfpic/dockerimage.png +0 -0
  83. package/SVF-doxygen/wiki/svfpic/dockernameImage.png +0 -0
  84. package/SVF-doxygen/wiki/svfpic/dockerpull.png +0 -0
  85. package/SVF-doxygen/wiki/svfpic/dockerpull2.png +0 -0
  86. package/SVF-doxygen/wiki/svfpic/download.jpg +0 -0
  87. package/SVF-doxygen/wiki/svfpic/extension1.jpeg +0 -0
  88. package/SVF-doxygen/wiki/svfpic/extension2.jpeg +0 -0
  89. package/SVF-doxygen/wiki/svfpic/graphviz.png +0 -0
  90. package/SVF-doxygen/wiki/svfpic/hellodb.png +0 -0
  91. package/SVF-doxygen/wiki/svfpic/hellodb2.png +0 -0
  92. package/SVF-doxygen/wiki/svfpic/hviz_0.png +0 -0
  93. package/SVF-doxygen/wiki/svfpic/hviz_1.png +0 -0
  94. package/SVF-doxygen/wiki/svfpic/hviz_2.png +0 -0
  95. package/SVF-doxygen/wiki/svfpic/installC:C++Ext.png +0 -0
  96. package/SVF-doxygen/wiki/svfpic/installCMakeExt.png +0 -0
  97. package/SVF-doxygen/wiki/svfpic/installRCext.png +0 -0
  98. package/SVF-doxygen/wiki/svfpic/installdockerext.png +0 -0
  99. package/SVF-doxygen/wiki/svfpic/launch1.png +0 -0
  100. package/SVF-doxygen/wiki/svfpic/openfile.png +0 -0
  101. package/SVF-doxygen/wiki/svfpic/pathfolder.png +0 -0
  102. package/SVF-doxygen/wiki/svfpic/restart.png +0 -0
  103. package/SVF-doxygen/wiki/svfpic/rundocker.png +0 -0
  104. package/SVF-doxygen/wiki/svfpic/runinCLI.png +0 -0
  105. package/SVF-doxygen/wiki/svfpic/screen.png +0 -0
  106. package/SVF-doxygen/wiki/svfpic/settings1.jpg +0 -0
  107. package/SVF-doxygen/wiki/svfpic/settings2.jpg +0 -0
  108. package/SVF-doxygen/wiki/svfpic/settings3.jpg +0 -0
  109. package/SVF-doxygen/wiki/svfpic/shortlists.png +0 -0
  110. package/SVF-doxygen/wiki/svfpic/start.png +0 -0
  111. package/SVF-doxygen/wiki/svfpic/start1.png +0 -0
  112. package/SVF-doxygen/wiki/svfpic/update0.png +0 -0
  113. package/SVF-doxygen/wiki/svfpic/verify_docker.png +0 -0
  114. package/SVF-doxygen/wiki/svfpic/vs_entry_window.png +0 -0
  115. package/SVF-doxygen/wiki/svfpic/wsl.png +0 -0
  116. package/SVF-doxygen/wiki/svfpic/wsl_1.png +0 -0
  117. package/SVF-doxygen/wiki/svfpic/wsl_2.png +0 -0
  118. package/SVF-doxygen/wiki/svfpic/wsl_3.png +0 -0
  119. package/SVF-doxygen/wiki/tools.png +0 -0
  120. package/SVF-doxygen/wiki/users.png +0 -0
  121. package/SVF-doxygen/wiki/vm1.png +0 -0
  122. package/SVF-doxygen/wiki/vm2.png +0 -0
  123. package/SVF-doxygen/wiki/vm3.png +0 -0
  124. package/SVF-doxygen/wiki/vm4.png +0 -0
  125. package/SVF-doxygen/wiki/vm5.png +0 -0
  126. package/SVF-doxygen/wiki/vscode_build_tasks.png +0 -0
  127. package/SVF-doxygen/wiki/vscode_cpp_extension.png +0 -0
  128. package/SVF-doxygen/wiki/vscode_debug_list.png +0 -0
  129. package/SVF-doxygen/wiki/vscode_dir_structure.png +0 -0
package/build.sh CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.1073",
3
+ "version": "1.0.1074",
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": {
@@ -36,6 +36,7 @@
36
36
 
37
37
  #include "Graphs/ICFG.h"
38
38
  #include "Graphs/WTO.h"
39
+ #include "Graphs/CallGraph.h"
39
40
 
40
41
  namespace SVF
41
42
  {
@@ -77,6 +78,58 @@ public:
77
78
  }
78
79
  }
79
80
  };
81
+
82
+ // Added for IWTO
83
+ class ICFGIWTO : public ICFGWTO
84
+ {
85
+ public:
86
+ typedef ICFGWTO Base;
87
+ typedef WTOComponentVisitor<ICFG>::WTONodeT ICFGWTONode;
88
+ NodeBS &funcPar;
89
+ CallGraph *cg;
90
+
91
+ explicit ICFGIWTO(ICFG* graph, const ICFGNode* node, NodeBS & funcPar, CallGraph* cg) :
92
+ Base(graph, node), funcPar(funcPar), cg(cg) {}
93
+
94
+ virtual ~ICFGIWTO()
95
+ {
96
+ }
97
+
98
+ inline void forEachSuccessor(
99
+ const ICFGNode* node,
100
+ std::function<void(const ICFGNode*)> func) const override
101
+ {
102
+ if (const auto* callNode = SVFUtil::dyn_cast<CallICFGNode>(node))
103
+ {
104
+
105
+ for (const auto &e : callNode->getOutEdges())
106
+ {
107
+ ICFGNode *calleeEntryICFGNode = e->getDstNode();
108
+ CallGraphNode * calleeCGNode = cg->getCallGraphNode(calleeEntryICFGNode->getFun());
109
+
110
+ const ICFGNode* succ = nullptr;
111
+ if (funcPar.test(calleeCGNode->getId()))
112
+ succ = calleeEntryICFGNode;
113
+ else
114
+ succ = callNode->getRetICFGNode();
115
+
116
+ func(succ);
117
+ }
118
+ }
119
+ else
120
+ {
121
+ for (const auto& e : node->getOutEdges())
122
+ {
123
+ ICFGNode *succ = e->getDstNode();
124
+ CallGraphNode *succCGNode = cg->getCallGraphNode(succ->getFun());
125
+ if (!funcPar.test(succCGNode->getId()))
126
+ continue;
127
+ func(succ);
128
+ }
129
+ }
130
+ }
131
+ };
132
+
80
133
  } // namespace SVF
81
134
 
82
135
  #endif // SVF_ICFGWTO_H
@@ -28,9 +28,7 @@
28
28
  #include "AE/Core/AbstractState.h"
29
29
  #include "AE/Core/ICFGWTO.h"
30
30
  #include "AE/Svfexe/AEDetector.h"
31
- #include "AE/Svfexe/AbsExtAPI.h"
32
31
  #include "Util/SVFBugReport.h"
33
- #include "WPA/Andersen.h"
34
32
 
35
33
  namespace SVF
36
34
  {
@@ -33,7 +33,8 @@
33
33
  #include "AE/Svfexe/AEDetector.h"
34
34
  #include "AE/Svfexe/AbsExtAPI.h"
35
35
  #include "Util/SVFBugReport.h"
36
- #include "WPA/Andersen.h"
36
+ #include "Util/SVFStat.h"
37
+ #include "Graphs/SCC.h"
37
38
 
38
39
  namespace SVF
39
40
  {
@@ -107,6 +108,29 @@ class AbstractInterpretation
107
108
 
108
109
  public:
109
110
  typedef SCCDetection<CallGraph*> CallGraphSCC;
111
+
112
+ /*
113
+ * For recursive test case
114
+ * int demo(int a) {
115
+ if (a >= 10000)
116
+ return a;
117
+ demo(a+1);
118
+ }
119
+
120
+ int main() {
121
+ int result = demo(0);
122
+ }
123
+ * if set TOP, result = [-oo, +oo] since the return value, and any stored object pointed by q at *q = p in recursive functions will be set to the top value.
124
+ * if set WIDEN_ONLY, result = [10000, +oo] since only widening is applied at the cycle head of recursive functions without narrowing.
125
+ * if set WIDEN_NARROW, result = [10000, 10000] since both widening and narrowing are applied at the cycle head of recursive functions.
126
+ * */
127
+ enum HandleRecur
128
+ {
129
+ TOP,
130
+ WIDEN_ONLY,
131
+ WIDEN_NARROW
132
+ };
133
+
110
134
  /// Constructor
111
135
  AbstractInterpretation();
112
136
 
@@ -135,7 +159,7 @@ private:
135
159
  /// Global ICFGNode is handled at the entry of the program,
136
160
  virtual void handleGlobalNode();
137
161
 
138
- /// Mark recursive functions in the call graph
162
+ /// Compute IWTO for each function partition entry
139
163
  void initWTO();
140
164
 
141
165
  /**
@@ -251,7 +275,8 @@ private:
251
275
  AEStat* stat;
252
276
 
253
277
  std::vector<const CallICFGNode*> callSiteStack;
254
- Map<const FunObjVar*, ICFGWTO*> funcToWTO;
278
+ Map<const FunObjVar*, const ICFGWTO*> funcToWTO;
279
+ Set<std::pair<const CallICFGNode*, NodeID>> nonRecursiveCallSites;
255
280
  Set<const FunObjVar*> recursiveFuns;
256
281
 
257
282
 
@@ -282,8 +307,10 @@ private:
282
307
  // helper functions in handleCallSite
283
308
  virtual bool isExtCall(const CallICFGNode* callNode);
284
309
  virtual void extCallPass(const CallICFGNode* callNode);
310
+ virtual bool isRecursiveFun(const FunObjVar* fun);
285
311
  virtual bool isRecursiveCall(const CallICFGNode* callNode);
286
- virtual void recursiveCallPass(const CallICFGNode* callNode);
312
+ virtual void recursiveCallPass(const CallICFGNode *callNode);
313
+ virtual bool isRecursiveCallSite(const CallICFGNode* callNode, const FunObjVar *);
287
314
  virtual bool isDirectCall(const CallICFGNode* callNode);
288
315
  virtual void directCallFunPass(const CallICFGNode* callNode);
289
316
  virtual bool isIndirectCall(const CallICFGNode* callNode);
@@ -11,6 +11,7 @@
11
11
  #include "Util/NodeIDAllocator.h"
12
12
  #include "MSSA/MemSSA.h"
13
13
  #include "WPA/WPAPass.h"
14
+ #include "AE/Svfexe/AbstractInterpretation.h"
14
15
 
15
16
  namespace SVF
16
17
  {
@@ -244,6 +245,8 @@ public:
244
245
 
245
246
  // Abstract Execution
246
247
  static const Option<u32_t> WidenDelay;
248
+ /// recursion handling mode, Default: TOP
249
+ static const OptionMap<AbstractInterpretation::HandleRecur> HandleRecur;
247
250
  /// the max time consumptions (seconds). Default: 4 hours 14400s
248
251
  static const Option<u32_t> Timeout;
249
252
  /// bug info output file, Default: output.db
@@ -26,6 +26,8 @@
26
26
  //
27
27
  #include "AE/Svfexe/AbsExtAPI.h"
28
28
  #include "AE/Svfexe/AbstractInterpretation.h"
29
+ #include "WPA/Andersen.h"
30
+ #include "Util/Options.h"
29
31
 
30
32
  using namespace SVF;
31
33
  AbsExtAPI::AbsExtAPI(Map<const ICFGNode*, AbstractState>& traces): abstractTrace(traces)