svf-tools 1.0.518 → 1.0.521

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 (69) hide show
  1. package/SVF-doxygen/html/html/CFLAlias_8cpp_source.html +2 -2
  2. package/SVF-doxygen/html/html/CFLAlias_8h_source.html +13 -10
  3. package/SVF-doxygen/html/html/CFLGrammar_8txt.html +57 -21
  4. package/SVF-doxygen/html/html/ExtAPI_8cpp_source.html +19 -19
  5. package/SVF-doxygen/html/html/ExtAPI_8h_source.html +49 -48
  6. package/SVF-doxygen/html/html/GrammarBuilder_8cpp_source.html +4 -4
  7. package/SVF-doxygen/html/html/GrammarBuilder_8h_source.html +3 -3
  8. package/SVF-doxygen/html/html/Graph2Json_8cpp_source.html +1 -1
  9. package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +2 -1
  10. package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +1 -1
  11. package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +6 -6
  12. package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +17 -7
  13. package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.png +0 -0
  14. package/SVF-doxygen/html/html/classSVF_1_1CFLAlias-members.html +118 -75
  15. package/SVF-doxygen/html/html/classSVF_1_1CFLAlias.html +168 -58
  16. package/SVF-doxygen/html/html/classSVF_1_1CFLAlias.png +0 -0
  17. package/SVF-doxygen/html/html/classSVF_1_1ExtAPI-members.html +29 -28
  18. package/SVF-doxygen/html/html/classSVF_1_1ExtAPI.html +94 -91
  19. package/SVF-doxygen/html/html/classSVF_1_1GrammarBuilder.html +10 -10
  20. package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +8 -8
  21. package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.png +0 -0
  22. package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +45 -42
  23. package/SVF-doxygen/html/html/functions_e.html +4 -1
  24. package/SVF-doxygen/html/html/functions_eval_e.html +3 -0
  25. package/SVF-doxygen/html/html/functions_func_g.html +11 -9
  26. package/SVF-doxygen/html/html/functions_func_p.html +1 -1
  27. package/SVF-doxygen/html/html/functions_g.html +12 -10
  28. package/SVF-doxygen/html/html/functions_o.html +3 -3
  29. package/SVF-doxygen/html/html/functions_p.html +7 -7
  30. package/SVF-doxygen/html/html/functions_r.html +3 -3
  31. package/SVF-doxygen/html/html/functions_s.html +7 -9
  32. package/SVF-doxygen/html/html/functions_t.html +3 -1
  33. package/SVF-doxygen/html/html/functions_w.html +11 -11
  34. package/SVF-doxygen/html/html/globals_g.html +7 -4
  35. package/SVF-doxygen/html/html/globals_v.html +4 -1
  36. package/SVF-doxygen/html/html/globals_vars.html +11 -5
  37. package/SVF-doxygen/html/html/hierarchy.html +6 -6
  38. package/SVF-doxygen/html/html/search/all_10.js +5 -5
  39. package/SVF-doxygen/html/html/search/all_11.js +2 -2
  40. package/SVF-doxygen/html/html/search/all_12.js +9 -9
  41. package/SVF-doxygen/html/html/search/all_13.js +4 -4
  42. package/SVF-doxygen/html/html/search/all_14.js +1 -1
  43. package/SVF-doxygen/html/html/search/all_15.js +3 -2
  44. package/SVF-doxygen/html/html/search/all_16.js +2 -2
  45. package/SVF-doxygen/html/html/search/all_5.js +1 -0
  46. package/SVF-doxygen/html/html/search/all_7.js +5 -3
  47. package/SVF-doxygen/html/html/search/all_c.js +1 -1
  48. package/SVF-doxygen/html/html/search/all_e.js +1 -1
  49. package/SVF-doxygen/html/html/search/all_f.js +1 -1
  50. package/SVF-doxygen/html/html/search/enumvalues_4.js +1 -0
  51. package/SVF-doxygen/html/html/search/functions_6.js +2 -1
  52. package/SVF-doxygen/html/html/search/functions_f.js +1 -1
  53. package/SVF-doxygen/html/html/search/variables_13.js +4 -4
  54. package/SVF-doxygen/html/html/search/variables_14.js +1 -1
  55. package/SVF-doxygen/html/html/search/variables_15.js +2 -1
  56. package/SVF-doxygen/html/html/search/variables_7.js +3 -2
  57. package/SVF-doxygen/html/html/search/variables_e.js +1 -1
  58. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01CFLGraph_01_5_01_4.html +1 -1
  59. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01ConstraintGraph_01_5_01_4.html +1 -1
  60. package/codecov.yml +21 -0
  61. package/include/CFL/CFLAlias.h +9 -7
  62. package/include/CFL/CFLGrammar.txt +10 -9
  63. package/include/Util/ExtAPI.h +2 -0
  64. package/include/Util/ExtAPI.json +5 -0
  65. package/lib/CFL/CFLAlias.cpp +2 -2
  66. package/lib/CFL/GrammarBuilder.cpp +4 -2
  67. package/lib/MemoryModel/PointerAnalysisImpl.cpp +1 -1
  68. package/lib/SVF-FE/SVFIRBuilder.cpp +16 -0
  69. package/package.json +1 -1
@@ -40,13 +40,13 @@
40
40
  namespace SVF
41
41
  {
42
42
 
43
- class CFLAlias : public PointerAnalysis
43
+ class CFLAlias : public BVDataPTAImpl
44
44
  {
45
45
 
46
46
  public:
47
47
  typedef OrderedMap<CallSite, NodeID> CallSite2DummyValPN;
48
48
 
49
- CFLAlias(SVFIR* ir) : PointerAnalysis(ir, PointerAnalysis::CFLFICI_WPA), svfir(ir), graph(nullptr), grammar(nullptr), solver(nullptr)
49
+ CFLAlias(SVFIR* ir) : BVDataPTAImpl(ir, PointerAnalysis::CFLFICI_WPA), svfir(ir), graph(nullptr), grammar(nullptr), solver(nullptr)
50
50
  {
51
51
  }
52
52
 
@@ -77,10 +77,9 @@ public:
77
77
  }
78
78
 
79
79
  /// Get points-to targets of a pointer. V In this context
80
- virtual const PointsTo& getPts(NodeID ptr)
80
+ virtual const PointsTo& getCFLPts(NodeID ptr)
81
81
  {
82
82
  /// Check V Dst of ptr.
83
- PointsTo *ps = new PointsTo();
84
83
  CFLNode *funNode = graph->getGNode(ptr);
85
84
  for(auto outedge = funNode->getOutEdges().begin(); outedge!=funNode->getOutEdges().end(); outedge++)
86
85
  {
@@ -88,19 +87,22 @@ public:
88
87
  {
89
88
  // Need to Find dst addr src
90
89
  CFLNode *vNode = graph->getGNode((*outedge)->getDstID());
91
-
90
+ addPts(ptr, svfir->getBaseValVar((*outedge)->getDstID()));
92
91
  for(auto inEdge = vNode->getInEdges().begin(); inEdge!=vNode->getInEdges().end(); inEdge++)
93
92
  {
94
93
  if((*inEdge)->getEdgeKind() == 0)
95
94
  {
96
- ps->set((*inEdge)->getSrcID());
95
+ addPts(ptr, (*inEdge)->getSrcID());
97
96
  }
98
97
  }
99
98
  }
100
99
  }
101
- return *ps;
100
+ return getPts(ptr);
102
101
  }
103
102
 
103
+ /// Need Original one for virtual table
104
+
105
+
104
106
  /// Add copy edge on constraint graph
105
107
  virtual inline bool addCopyEdge(NodeID src, NodeID dst)
106
108
  {
@@ -1,5 +1,5 @@
1
1
  Start:
2
- V
2
+ V
3
3
  Terminal:
4
4
  Addr Copy Store Load Gep Vgep
5
5
  Productions:
@@ -19,8 +19,14 @@ Productions:
19
19
  V -> Gepbarpath V Gep_0;
20
20
  V -> Gepbar_i F Gep_i;
21
21
  V -> Gepbar_i Fbar Gep_i;
22
- Gep_j -> Gep_i F Vgep;
23
- Gepbar_j -> Vgepbar Fbar Gepbar_i;
22
+ Copy -> Vgep;
23
+ Copybar -> Vgepbar;
24
+ Gep_1 -> Gep_0 F Gep_1;
25
+ Gepbar_1 -> Gepbar_1 Fbar Gepbar_0;
26
+ Gep_1 -> Gep_0 F Vgep;
27
+ Gepbar_1 -> Vgepbar Fbar Gepbar_0;
28
+ Gepbarpath -> Gepbar_0 Gepbar_0;
29
+ Gepbarpath -> Gepbarpath Gepbar_0;
24
30
  Memflow -> Load Store;
25
31
  Memflow -> Fbar Memflow;
26
32
  Memflow -> F Memflow Fbar;
@@ -30,9 +36,4 @@ Productions:
30
36
  Memflowbar -> Memflowbar F;
31
37
  Memflowbar -> F Memflowbar Fbar;
32
38
  Memflowbar -> Gep_i Memflowbar Gepbar_i;
33
- Memflowbar -> Gepbar_i Memflowbar Gep_i;
34
- Gepbarpath -> Gepbar_i Gepbar_j;
35
- Gepbarpath -> Gepbarpath Gepbar_i;
36
-
37
-
38
-
39
+ Memflowbar -> Gepbar_i Memflowbar Gep_i;
@@ -109,6 +109,7 @@ public:
109
109
  EXT_COPY, // Handle copy edge
110
110
  EXT_LOAD, // Handle load edge
111
111
  EXT_STORE, // Handle store edge
112
+ EXT_GEPGEP, // Handle Gep and Gep edges, and add a dummy node
112
113
  EXT_LOADSTORE, // Handle load and store edges, and add a dummy node
113
114
  EXT_COPY_N, // Copy the character c (an unsigned char) to the first n characters of the string pointed to, by the argument str
114
115
  EXT_COPY_MN, // Copies n characters from memory area src to memory area dest.
@@ -170,6 +171,7 @@ private:
170
171
  {"copy", EXT_COPY},
171
172
  {"load", EXT_LOAD},
172
173
  {"store", EXT_STORE},
174
+ {"gep_gep", EXT_GEPGEP},
173
175
  {"load_store", EXT_LOADSTORE},
174
176
  {"copy_n", EXT_COPY_N},
175
177
  {"copy_mn", EXT_COPY_MN},
@@ -3270,5 +3270,10 @@
3270
3270
  "type": "CPP_EFT_DYNAMIC_CAST",
3271
3271
  "overwrite_app_function": 0,
3272
3272
  "copy": ["A0", "L"]
3273
+ },
3274
+ "_ZNSt5arrayIPK1ALm2EE4backEv":{
3275
+ "type": "CPP_EFT_DYNAMIC_CAST",
3276
+ "overwrite_app_function": 1,
3277
+ "gep_gep": ["A0", "0", "V", "0", "L"]
3273
3278
  }
3274
3279
  }
@@ -50,10 +50,10 @@ void CFLAlias::onTheFlyCallGraphSolve(const CallSiteToFunPtrMap& callsites, Call
50
50
  const Value *vtbl = getVCallVtblPtr(SVFUtil::getLLVMCallSite(cs->getCallSite()));
51
51
  assert(pag->hasValueNode(vtbl));
52
52
  NodeID vtblId = pag->getValueNode(vtbl);
53
- resolveCPPIndCalls(cs, getPts(vtblId), newEdges);
53
+ resolveCPPIndCalls(cs, getCFLPts(vtblId), newEdges);
54
54
  }
55
55
  else
56
- resolveIndCalls(iter->first,getPts(iter->second),newEdges);
56
+ resolveIndCalls(iter->first,getCFLPts(iter->second),newEdges);
57
57
  }
58
58
  }
59
59
 
@@ -42,6 +42,7 @@ const inline std::string GrammarBuilder::parseProductionsString() const
42
42
  std::string lineString;
43
43
  std::string lines = "";
44
44
  std::string startString;
45
+ const std::string WHITESPACE = " \n\r\t\f\v";
45
46
  int lineNum = 0;
46
47
  while (getline(textFile, lineString))
47
48
  {
@@ -49,11 +50,12 @@ const inline std::string GrammarBuilder::parseProductionsString() const
49
50
  {
50
51
  startString = stripSpace(lineString);
51
52
  }
52
- lines.append(lineString);
53
+
54
+ lines.append(lineString.substr(lineString.find_first_not_of(WHITESPACE), lineString.find_last_not_of(WHITESPACE)+1));
53
55
  lineNum++;
54
56
  }
55
57
 
56
- std::regex reg("Start:([\\s\\S]*)Terminal:[\\s]*([\\s\\S]*)Productions:([\\s\\S]*)");
58
+ std::regex reg("Start:([\\s\\S]*)Terminal:([\\s\\S]*)Productions:([\\s\\S]*)");
57
59
  std::smatch matches;
58
60
  if (std::regex_search(lines, matches, reg))
59
61
  {
@@ -27,7 +27,7 @@ BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PointerAnalysis::PTATY type, bool alias_c
27
27
  {
28
28
  if (type == Andersen_BASE || type == Andersen_WPA || type == AndersenWaveDiff_WPA
29
29
  || type == TypeCPP_WPA || type == FlowS_DDA
30
- || type == AndersenSCD_WPA || type == AndersenSFR_WPA)
30
+ || type == AndersenSCD_WPA || type == AndersenSFR_WPA || type == CFLFICI_WPA )
31
31
  {
32
32
  // Only maintain reverse points-to when the analysis is field-sensitive, as objects turning
33
33
  // field-insensitive is all it is used for.
@@ -1404,6 +1404,22 @@ void SVFIRBuilder::handleExtCall(CallSite cs, const SVFFunction *callee)
1404
1404
  }
1405
1405
  break;
1406
1406
  }
1407
+ case ExtAPI::EXT_GEPGEP:
1408
+ {
1409
+ NodeID vnS = parseNode(args[0], cs, inst);
1410
+ u32_t offset1 = stoul(args[1]);
1411
+ NodeID vnV = parseNode(args[2], cs, inst);
1412
+ u32_t offset2 = stoul(args[3]);
1413
+ NodeID vnD = parseNode(args[4], cs, inst);
1414
+ if (vnD && vnV && vnS)
1415
+ {
1416
+ LocationSet l1(offset1);
1417
+ LocationSet l2(offset2);
1418
+ addNormalGepEdge(vnS, vnV, l1);
1419
+ addNormalGepEdge(vnV, vnD, l2);
1420
+ }
1421
+ break;
1422
+ }
1407
1423
  // default
1408
1424
  // illegal function operation of external function
1409
1425
  case ExtAPI::EXT_OTHER:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.518",
3
+ "version": "1.0.521",
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": {