svf-tools 1.0.913 → 1.0.915

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 (264) hide show
  1. package/SVF-doxygen/html/AbstractInterpretation_8cpp.html +7 -5
  2. package/SVF-doxygen/html/AbstractInterpretation_8cpp_source.html +1593 -1610
  3. package/SVF-doxygen/html/AbstractInterpretation_8h_source.html +157 -144
  4. package/SVF-doxygen/html/BufOverflowChecker_8cpp_source.html +797 -786
  5. package/SVF-doxygen/html/BufOverflowChecker_8h_source.html +7 -7
  6. package/SVF-doxygen/html/SVFIR2AbsState_8cpp_source.html +815 -826
  7. package/SVF-doxygen/html/SVFIR2AbsState_8h_source.html +153 -196
  8. package/SVF-doxygen/html/classSVF_1_1AEStat.html +116 -120
  9. package/SVF-doxygen/html/classSVF_1_1AbstractInterpretation-members.html +33 -33
  10. package/SVF-doxygen/html/classSVF_1_1AbstractInterpretation.html +1739 -1684
  11. package/SVF-doxygen/html/classSVF_1_1BufOverflowChecker-members.html +33 -33
  12. package/SVF-doxygen/html/classSVF_1_1BufOverflowChecker.html +471 -462
  13. package/SVF-doxygen/html/classSVF_1_1SVFIR2AbsState-members.html +35 -47
  14. package/SVF-doxygen/html/classSVF_1_1SVFIR2AbsState.html +1261 -1546
  15. package/SVF-doxygen/html/dir_9a8e7a56f4029a0d9f62b1c6d1f6e85b.html +0 -2
  16. package/SVF-doxygen/html/files.html +0 -1
  17. package/SVF-doxygen/html/functions.html +4 -7
  18. package/SVF-doxygen/html/functions_a.html +2 -2
  19. package/SVF-doxygen/html/functions_f.html +3 -3
  20. package/SVF-doxygen/html/functions_func.html +2 -2
  21. package/SVF-doxygen/html/functions_func_g.html +16 -16
  22. package/SVF-doxygen/html/functions_func_h.html +21 -57
  23. package/SVF-doxygen/html/functions_func_i.html +21 -12
  24. package/SVF-doxygen/html/functions_func_n.html +1 -1
  25. package/SVF-doxygen/html/functions_func_s.html +13 -19
  26. package/SVF-doxygen/html/functions_func_t.html +1 -1
  27. package/SVF-doxygen/html/functions_func_w.html +1 -1
  28. package/SVF-doxygen/html/functions_g.html +16 -16
  29. package/SVF-doxygen/html/functions_h.html +18 -54
  30. package/SVF-doxygen/html/functions_i.html +32 -23
  31. package/SVF-doxygen/html/functions_l.html +3 -3
  32. package/SVF-doxygen/html/functions_n.html +1 -1
  33. package/SVF-doxygen/html/functions_o.html +4 -4
  34. package/SVF-doxygen/html/functions_p.html +19 -17
  35. package/SVF-doxygen/html/functions_r.html +6 -6
  36. package/SVF-doxygen/html/functions_s.html +18 -26
  37. package/SVF-doxygen/html/functions_t.html +4 -4
  38. package/SVF-doxygen/html/functions_v.html +6 -6
  39. package/SVF-doxygen/html/functions_vars.html +4 -7
  40. package/SVF-doxygen/html/functions_w.html +1 -1
  41. package/SVF-doxygen/html/search/all_0.js +131 -132
  42. package/SVF-doxygen/html/search/all_1.js +504 -504
  43. package/SVF-doxygen/html/search/all_10.js +326 -326
  44. package/SVF-doxygen/html/search/all_11.js +227 -227
  45. package/SVF-doxygen/html/search/all_12.js +559 -562
  46. package/SVF-doxygen/html/search/all_13.js +186 -186
  47. package/SVF-doxygen/html/search/all_14.js +74 -74
  48. package/SVF-doxygen/html/search/all_15.js +175 -175
  49. package/SVF-doxygen/html/search/all_16.js +77 -77
  50. package/SVF-doxygen/html/search/all_17.js +1 -1
  51. package/SVF-doxygen/html/search/all_18.js +1 -1
  52. package/SVF-doxygen/html/search/all_19.js +27 -27
  53. package/SVF-doxygen/html/search/all_1a.js +174 -174
  54. package/SVF-doxygen/html/search/all_2.js +180 -180
  55. package/SVF-doxygen/html/search/all_3.js +635 -635
  56. package/SVF-doxygen/html/search/all_4.js +237 -237
  57. package/SVF-doxygen/html/search/all_5.js +120 -120
  58. package/SVF-doxygen/html/search/all_6.js +236 -236
  59. package/SVF-doxygen/html/search/all_7.js +1039 -1039
  60. package/SVF-doxygen/html/search/all_8.js +212 -224
  61. package/SVF-doxygen/html/search/all_9.js +630 -627
  62. package/SVF-doxygen/html/search/all_a.js +46 -46
  63. package/SVF-doxygen/html/search/all_b.js +24 -24
  64. package/SVF-doxygen/html/search/all_c.js +111 -111
  65. package/SVF-doxygen/html/search/all_d.js +204 -204
  66. package/SVF-doxygen/html/search/all_e.js +207 -207
  67. package/SVF-doxygen/html/search/all_f.js +122 -122
  68. package/SVF-doxygen/html/search/classes_0.js +29 -29
  69. package/SVF-doxygen/html/search/classes_1.js +11 -11
  70. package/SVF-doxygen/html/search/classes_10.js +71 -71
  71. package/SVF-doxygen/html/search/classes_11.js +14 -14
  72. package/SVF-doxygen/html/search/classes_12.js +2 -2
  73. package/SVF-doxygen/html/search/classes_13.js +10 -10
  74. package/SVF-doxygen/html/search/classes_14.js +19 -19
  75. package/SVF-doxygen/html/search/classes_15.js +1 -1
  76. package/SVF-doxygen/html/search/classes_2.js +72 -72
  77. package/SVF-doxygen/html/search/classes_3.js +35 -35
  78. package/SVF-doxygen/html/search/classes_4.js +7 -7
  79. package/SVF-doxygen/html/search/classes_5.js +28 -28
  80. package/SVF-doxygen/html/search/classes_6.js +98 -98
  81. package/SVF-doxygen/html/search/classes_7.js +33 -33
  82. package/SVF-doxygen/html/search/classes_8.js +57 -57
  83. package/SVF-doxygen/html/search/classes_9.js +1 -1
  84. package/SVF-doxygen/html/search/classes_a.js +12 -12
  85. package/SVF-doxygen/html/search/classes_b.js +29 -29
  86. package/SVF-doxygen/html/search/classes_c.js +6 -6
  87. package/SVF-doxygen/html/search/classes_d.js +19 -19
  88. package/SVF-doxygen/html/search/classes_e.js +36 -36
  89. package/SVF-doxygen/html/search/classes_f.js +25 -25
  90. package/SVF-doxygen/html/search/defines_0.js +3 -3
  91. package/SVF-doxygen/html/search/defines_1.js +3 -3
  92. package/SVF-doxygen/html/search/defines_10.js +2 -2
  93. package/SVF-doxygen/html/search/defines_2.js +30 -30
  94. package/SVF-doxygen/html/search/defines_3.js +20 -20
  95. package/SVF-doxygen/html/search/defines_4.js +3 -3
  96. package/SVF-doxygen/html/search/defines_5.js +4 -4
  97. package/SVF-doxygen/html/search/defines_6.js +2 -2
  98. package/SVF-doxygen/html/search/defines_7.js +5 -5
  99. package/SVF-doxygen/html/search/defines_8.js +11 -11
  100. package/SVF-doxygen/html/search/defines_9.js +9 -9
  101. package/SVF-doxygen/html/search/defines_a.js +2 -2
  102. package/SVF-doxygen/html/search/defines_b.js +1 -1
  103. package/SVF-doxygen/html/search/defines_c.js +3 -3
  104. package/SVF-doxygen/html/search/defines_d.js +2 -2
  105. package/SVF-doxygen/html/search/defines_e.js +8 -8
  106. package/SVF-doxygen/html/search/defines_f.js +4 -4
  107. package/SVF-doxygen/html/search/enums_0.js +3 -3
  108. package/SVF-doxygen/html/search/enums_1.js +2 -2
  109. package/SVF-doxygen/html/search/enums_10.js +1 -1
  110. package/SVF-doxygen/html/search/enums_11.js +1 -1
  111. package/SVF-doxygen/html/search/enums_2.js +9 -9
  112. package/SVF-doxygen/html/search/enums_3.js +2 -2
  113. package/SVF-doxygen/html/search/enums_4.js +3 -3
  114. package/SVF-doxygen/html/search/enums_5.js +1 -1
  115. package/SVF-doxygen/html/search/enums_6.js +2 -2
  116. package/SVF-doxygen/html/search/enums_7.js +2 -2
  117. package/SVF-doxygen/html/search/enums_8.js +4 -4
  118. package/SVF-doxygen/html/search/enums_9.js +1 -1
  119. package/SVF-doxygen/html/search/enums_a.js +1 -1
  120. package/SVF-doxygen/html/search/enums_b.js +7 -7
  121. package/SVF-doxygen/html/search/enums_c.js +1 -1
  122. package/SVF-doxygen/html/search/enums_d.js +4 -4
  123. package/SVF-doxygen/html/search/enums_e.js +2 -2
  124. package/SVF-doxygen/html/search/enums_f.js +4 -4
  125. package/SVF-doxygen/html/search/enumvalues_0.js +15 -15
  126. package/SVF-doxygen/html/search/enumvalues_1.js +16 -16
  127. package/SVF-doxygen/html/search/enumvalues_10.js +36 -36
  128. package/SVF-doxygen/html/search/enumvalues_11.js +6 -6
  129. package/SVF-doxygen/html/search/enumvalues_12.js +10 -10
  130. package/SVF-doxygen/html/search/enumvalues_13.js +1 -1
  131. package/SVF-doxygen/html/search/enumvalues_14.js +1 -1
  132. package/SVF-doxygen/html/search/enumvalues_15.js +4 -4
  133. package/SVF-doxygen/html/search/enumvalues_2.js +36 -36
  134. package/SVF-doxygen/html/search/enumvalues_3.js +13 -13
  135. package/SVF-doxygen/html/search/enumvalues_4.js +2 -2
  136. package/SVF-doxygen/html/search/enumvalues_5.js +50 -50
  137. package/SVF-doxygen/html/search/enumvalues_6.js +6 -6
  138. package/SVF-doxygen/html/search/enumvalues_7.js +8 -8
  139. package/SVF-doxygen/html/search/enumvalues_8.js +24 -24
  140. package/SVF-doxygen/html/search/enumvalues_9.js +6 -6
  141. package/SVF-doxygen/html/search/enumvalues_a.js +17 -17
  142. package/SVF-doxygen/html/search/enumvalues_b.js +11 -11
  143. package/SVF-doxygen/html/search/enumvalues_c.js +5 -5
  144. package/SVF-doxygen/html/search/enumvalues_d.js +19 -19
  145. package/SVF-doxygen/html/search/enumvalues_e.js +9 -9
  146. package/SVF-doxygen/html/search/enumvalues_f.js +48 -48
  147. package/SVF-doxygen/html/search/files_0.js +18 -18
  148. package/SVF-doxygen/html/search/files_1.js +9 -9
  149. package/SVF-doxygen/html/search/files_10.js +8 -8
  150. package/SVF-doxygen/html/search/files_11.js +8 -8
  151. package/SVF-doxygen/html/search/files_12.js +2 -2
  152. package/SVF-doxygen/html/search/files_2.js +51 -51
  153. package/SVF-doxygen/html/search/files_3.js +14 -14
  154. package/SVF-doxygen/html/search/files_4.js +3 -3
  155. package/SVF-doxygen/html/search/files_5.js +13 -13
  156. package/SVF-doxygen/html/search/files_6.js +10 -10
  157. package/SVF-doxygen/html/search/files_7.js +15 -15
  158. package/SVF-doxygen/html/search/files_8.js +13 -13
  159. package/SVF-doxygen/html/search/files_9.js +18 -18
  160. package/SVF-doxygen/html/search/files_a.js +3 -3
  161. package/SVF-doxygen/html/search/files_b.js +4 -4
  162. package/SVF-doxygen/html/search/files_c.js +20 -20
  163. package/SVF-doxygen/html/search/files_d.js +4 -4
  164. package/SVF-doxygen/html/search/files_e.js +56 -57
  165. package/SVF-doxygen/html/search/files_f.js +8 -8
  166. package/SVF-doxygen/html/search/functions_0.js +13 -13
  167. package/SVF-doxygen/html/search/functions_1.js +366 -366
  168. package/SVF-doxygen/html/search/functions_10.js +140 -140
  169. package/SVF-doxygen/html/search/functions_11.js +140 -140
  170. package/SVF-doxygen/html/search/functions_12.js +291 -293
  171. package/SVF-doxygen/html/search/functions_13.js +52 -52
  172. package/SVF-doxygen/html/search/functions_14.js +41 -41
  173. package/SVF-doxygen/html/search/functions_15.js +70 -70
  174. package/SVF-doxygen/html/search/functions_16.js +38 -38
  175. package/SVF-doxygen/html/search/functions_17.js +3 -3
  176. package/SVF-doxygen/html/search/functions_18.js +174 -174
  177. package/SVF-doxygen/html/search/functions_2.js +92 -92
  178. package/SVF-doxygen/html/search/functions_3.js +257 -257
  179. package/SVF-doxygen/html/search/functions_4.js +85 -85
  180. package/SVF-doxygen/html/search/functions_5.js +54 -54
  181. package/SVF-doxygen/html/search/functions_6.js +65 -65
  182. package/SVF-doxygen/html/search/functions_7.js +857 -857
  183. package/SVF-doxygen/html/search/functions_8.js +164 -176
  184. package/SVF-doxygen/html/search/functions_9.js +439 -436
  185. package/SVF-doxygen/html/search/functions_a.js +30 -30
  186. package/SVF-doxygen/html/search/functions_b.js +2 -2
  187. package/SVF-doxygen/html/search/functions_c.js +22 -22
  188. package/SVF-doxygen/html/search/functions_d.js +81 -81
  189. package/SVF-doxygen/html/search/functions_e.js +34 -34
  190. package/SVF-doxygen/html/search/functions_f.js +58 -58
  191. package/SVF-doxygen/html/search/namespaces_0.js +1 -1
  192. package/SVF-doxygen/html/search/namespaces_1.js +7 -7
  193. package/SVF-doxygen/html/search/related_0.js +4 -4
  194. package/SVF-doxygen/html/search/related_1.js +2 -2
  195. package/SVF-doxygen/html/search/related_2.js +2 -2
  196. package/SVF-doxygen/html/search/related_3.js +2 -2
  197. package/SVF-doxygen/html/search/related_4.js +2 -2
  198. package/SVF-doxygen/html/search/related_5.js +1 -1
  199. package/SVF-doxygen/html/search/related_6.js +2 -2
  200. package/SVF-doxygen/html/search/related_7.js +5 -5
  201. package/SVF-doxygen/html/search/related_8.js +2 -2
  202. package/SVF-doxygen/html/search/related_9.js +4 -4
  203. package/SVF-doxygen/html/search/related_a.js +19 -19
  204. package/SVF-doxygen/html/search/related_b.js +4 -4
  205. package/SVF-doxygen/html/search/related_c.js +2 -2
  206. package/SVF-doxygen/html/search/related_d.js +11 -11
  207. package/SVF-doxygen/html/search/related_e.js +2 -2
  208. package/SVF-doxygen/html/search/related_f.js +2 -2
  209. package/SVF-doxygen/html/search/typedefs_0.js +20 -20
  210. package/SVF-doxygen/html/search/typedefs_1.js +27 -27
  211. package/SVF-doxygen/html/search/typedefs_10.js +65 -65
  212. package/SVF-doxygen/html/search/typedefs_11.js +12 -12
  213. package/SVF-doxygen/html/search/typedefs_12.js +13 -13
  214. package/SVF-doxygen/html/search/typedefs_13.js +40 -40
  215. package/SVF-doxygen/html/search/typedefs_14.js +11 -11
  216. package/SVF-doxygen/html/search/typedefs_2.js +125 -125
  217. package/SVF-doxygen/html/search/typedefs_3.js +39 -39
  218. package/SVF-doxygen/html/search/typedefs_4.js +17 -17
  219. package/SVF-doxygen/html/search/typedefs_5.js +42 -42
  220. package/SVF-doxygen/html/search/typedefs_6.js +54 -54
  221. package/SVF-doxygen/html/search/typedefs_7.js +47 -47
  222. package/SVF-doxygen/html/search/typedefs_8.js +1 -1
  223. package/SVF-doxygen/html/search/typedefs_9.js +4 -4
  224. package/SVF-doxygen/html/search/typedefs_a.js +28 -28
  225. package/SVF-doxygen/html/search/typedefs_b.js +29 -29
  226. package/SVF-doxygen/html/search/typedefs_c.js +41 -41
  227. package/SVF-doxygen/html/search/typedefs_d.js +15 -15
  228. package/SVF-doxygen/html/search/typedefs_e.js +52 -52
  229. package/SVF-doxygen/html/search/typedefs_f.js +14 -14
  230. package/SVF-doxygen/html/search/variables_0.js +169 -170
  231. package/SVF-doxygen/html/search/variables_1.js +78 -78
  232. package/SVF-doxygen/html/search/variables_10.js +98 -98
  233. package/SVF-doxygen/html/search/variables_11.js +47 -47
  234. package/SVF-doxygen/html/search/variables_12.js +93 -93
  235. package/SVF-doxygen/html/search/variables_13.js +76 -76
  236. package/SVF-doxygen/html/search/variables_14.js +14 -14
  237. package/SVF-doxygen/html/search/variables_15.js +49 -49
  238. package/SVF-doxygen/html/search/variables_16.js +11 -11
  239. package/SVF-doxygen/html/search/variables_17.js +1 -1
  240. package/SVF-doxygen/html/search/variables_18.js +17 -17
  241. package/SVF-doxygen/html/search/variables_2.js +40 -40
  242. package/SVF-doxygen/html/search/variables_3.js +143 -143
  243. package/SVF-doxygen/html/search/variables_4.js +51 -51
  244. package/SVF-doxygen/html/search/variables_5.js +39 -39
  245. package/SVF-doxygen/html/search/variables_6.js +66 -66
  246. package/SVF-doxygen/html/search/variables_7.js +32 -32
  247. package/SVF-doxygen/html/search/variables_8.js +8 -8
  248. package/SVF-doxygen/html/search/variables_9.js +80 -80
  249. package/SVF-doxygen/html/search/variables_a.js +4 -4
  250. package/SVF-doxygen/html/search/variables_b.js +10 -10
  251. package/SVF-doxygen/html/search/variables_c.js +44 -44
  252. package/SVF-doxygen/html/search/variables_d.js +58 -58
  253. package/SVF-doxygen/html/search/variables_e.js +123 -123
  254. package/SVF-doxygen/html/search/variables_f.js +31 -31
  255. package/SVF-doxygen/html/svf-ex_8cpp.html +199 -197
  256. package/SVF-doxygen/html/svf-ex_8cpp_source.html +204 -202
  257. package/package.json +1 -1
  258. package/svf/include/AE/Svfexe/AbstractInterpretation.h +28 -21
  259. package/svf/include/AE/Svfexe/SVFIR2AbsState.h +37 -67
  260. package/svf/lib/AE/Svfexe/AbstractInterpretation.cpp +153 -169
  261. package/svf/lib/AE/Svfexe/BufOverflowChecker.cpp +64 -54
  262. package/svf/lib/AE/Svfexe/SVFIR2AbsState.cpp +134 -146
  263. package/svf-llvm/tools/Example/svf-ex.cpp +13 -12
  264. package/svf/lib/AE/Core/SVFIR2Relation.cpp +0 -193
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.913",
3
+ "version": "1.0.915",
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": {
@@ -154,7 +154,7 @@ protected:
154
154
  * @param intraEdge the edge from CmpStmt to the next node
155
155
  * @return if this edge is feasible
156
156
  */
157
- bool hasBranchES(const IntraCFGEdge* intraEdge, AbstractState& es);
157
+ bool isBranchFeasible(const IntraCFGEdge* intraEdge, AbstractState& as);
158
158
 
159
159
  /**
160
160
  * handle instructions in ICFGNode
@@ -205,12 +205,6 @@ protected:
205
205
  */
206
206
  virtual void SkipRecursiveCall(const CallICFGNode* callnode);
207
207
 
208
- /**
209
- * Check if this function is recursive function and skip it.
210
- *
211
- * @param func SVFFunction is a recursive function
212
- */
213
- virtual void SkipRecursiveFunc(const SVFFunction* func);
214
208
 
215
209
  /**
216
210
  * Check if this cmpStmt and succ are satisfiable to the execution state.
@@ -219,8 +213,8 @@ protected:
219
213
  * @param succ the value of cmpStmt (True or False)
220
214
  * @return if this ICFGNode has preceding execution state
221
215
  */
222
- bool hasCmpBranchES(const CmpStmt* cmpStmt, s64_t succ,
223
- AbstractState& es);
216
+ bool isCmpBranchFeasible(const CmpStmt* cmpStmt, s64_t succ,
217
+ AbstractState& as);
224
218
 
225
219
  /**
226
220
  * Check if this SwitchInst and succ are satisfiable to the execution state.
@@ -229,8 +223,8 @@ protected:
229
223
  * @param succ the case value of switch inst
230
224
  * @return if this ICFGNode has preceding execution state
231
225
  */
232
- bool hasSwitchBranchES(const SVFVar* var, s64_t succ,
233
- AbstractState& es);
226
+ bool isSwitchBranchFeasible(const SVFVar* var, s64_t succ,
227
+ AbstractState& as);
234
228
 
235
229
 
236
230
  /**
@@ -254,7 +248,7 @@ protected:
254
248
  * @param addr Address Stmt like malloc/calloc/ALLOCA/StackAlloc
255
249
  * @return the byte size e.g. int32_t a[10] -> return 40
256
250
  */
257
- u32_t getAllocaInstByteSize(const AddrStmt *addr);
251
+ u32_t getAllocaInstByteSize(AbstractState& as, const AddrStmt *addr);
258
252
 
259
253
  /**
260
254
  * get byte size of alloca inst
@@ -263,7 +257,7 @@ protected:
263
257
  * @param rhs SVFValue of string
264
258
  * @return the string
265
259
  */
266
- std::string strRead(const SVFValue* rhs);
260
+ std::string strRead(AbstractState& as,const SVFValue* rhs);
267
261
 
268
262
  /**
269
263
  * get length of string
@@ -272,7 +266,7 @@ protected:
272
266
  * @param strValue SVFValue of string
273
267
  * @return AbstractValue of string length
274
268
  */
275
- AbstractValue getStrlen(const SVF::SVFValue *strValue);
269
+ AbstractValue getStrlen(AbstractState& as, const SVF::SVFValue *strValue);
276
270
 
277
271
  /**
278
272
  * get memory allocation size
@@ -283,7 +277,7 @@ protected:
283
277
  * @param value to be traced
284
278
  * @return AbstractValue of allocation size
285
279
  */
286
- AbstractValue traceMemoryAllocationSize(const SVFValue *value);
280
+ AbstractValue traceMemoryAllocationSize(AbstractState& as, const SVFValue *value);
287
281
  /**
288
282
  * execute strcpy in abstract execution
289
283
  * e.g arr = new char[10]
@@ -310,7 +304,7 @@ protected:
310
304
  * we can set arr[3]='d', arr[4]='e', arr[5]='\0'
311
305
  * @param call callnode of memcpy like api
312
306
  */
313
- virtual void handleMemcpy(const SVFValue* dst, const SVFValue* src, AbstractValue len, u32_t start_idx);
307
+ virtual void handleMemcpy(AbstractState& as, const SVFValue* dst, const SVFValue* src, AbstractValue len, u32_t start_idx);
314
308
  /**
315
309
  * execute memset in abstract execution
316
310
  * e.g arr = new char[10]
@@ -318,7 +312,7 @@ protected:
318
312
  * we can set arr[0]='c', arr[1]='c', arr[2]='\0'
319
313
  * @param call callnode of memset like api
320
314
  */
321
- virtual void handleMemset(const SVFValue* dst, AbstractValue elem, AbstractValue len);
315
+ virtual void handleMemset(AbstractState& as, const SVFValue* dst, AbstractValue elem, AbstractValue len);
322
316
 
323
317
  /**
324
318
  * if this NodeID in SVFIR is a pointer, get the pointee type
@@ -327,14 +321,14 @@ protected:
327
321
  * we can set arr[0]='c', arr[1]='c', arr[2]='\0'
328
322
  * @param call callnode of memset like api
329
323
  */
330
- const SVFType* getPointeeElement(NodeID id);
324
+ const SVFType* getPointeeElement(AbstractState& as, NodeID id);
331
325
 
332
326
  void collectCheckPoint();
333
327
  void checkPointAllSet();
334
328
  // helper functions for traceMemoryAllocationSize and canSafelyAccessMemory
335
329
  void AccessMemoryViaRetNode(const CallICFGNode *callnode, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
336
330
  void AccessMemoryViaCopyStmt(const CopyStmt *copy, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
337
- void AccessMemoryViaLoadStmt(const LoadStmt *load, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
331
+ void AccessMemoryViaLoadStmt(AbstractState& as, const LoadStmt *load, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
338
332
  void AccessMemoryViaCallArgs(const SVF::SVFArgument *arg, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited);
339
333
 
340
334
 
@@ -375,13 +369,26 @@ protected:
375
369
  bool narrowFixpointPass(const ICFGNode* cycle_head,
376
370
  AbstractState& pre_es);
377
371
 
372
+ AbstractState& getAbsState(const ICFGNode* node)
373
+ {
374
+ const ICFGNode* repNode = _icfg->getRepNode(node);
375
+ if (_postAbsTrace.count(repNode) == 0)
376
+ {
377
+ assert(0 && "No preAbsTrace for this node");
378
+ }
379
+ else
380
+ {
381
+ return _postAbsTrace[repNode];
382
+ }
383
+ }
384
+
378
385
  protected:
379
386
  // there data should be shared with subclasses
380
387
  Map<std::string, std::function<void(const CallSite &)>> _func_map;
381
388
  Set<const CallICFGNode*> _checkpoints;
382
389
  Set<std::string> _checkpoint_names;
383
- Map<const ICFGNode*, AbstractState> _preAbstractTrace;
384
- Map<const ICFGNode*, AbstractState> _postAbstractTrace;
390
+ Map<const ICFGNode*, AbstractState> _preAbsTrace;
391
+ Map<const ICFGNode*, AbstractState> _postAbsTrace;
385
392
  std::string _moduleName;
386
393
  };
387
394
  }
@@ -46,15 +46,6 @@ public:
46
46
  public:
47
47
  SVFIR2AbsState(SVFIR *ir) : _svfir(ir) {}
48
48
 
49
- void setEs(const AbstractState&es)
50
- {
51
- _es = es;
52
- }
53
-
54
- AbstractState& getAbsState()
55
- {
56
- return _es;
57
- }
58
49
 
59
50
  void setRelEs(const RelExeState &relEs)
60
51
  {
@@ -66,34 +57,34 @@ public:
66
57
  return _relEs;
67
58
  }
68
59
 
69
- void widenAddrs(AbstractState&lhs, const AbstractState&rhs);
60
+ void widenAddrs(AbstractState& es, AbstractState&lhs, const AbstractState&rhs);
70
61
 
71
- void narrowAddrs(AbstractState&lhs, const AbstractState&rhs);
62
+ void narrowAddrs(AbstractState& es, AbstractState&lhs, const AbstractState&rhs);
72
63
 
73
64
  /// Return the field address given a pointer points to a struct object and an offset
74
- AbstractValue getGepObjAddress(u32_t pointer, APOffset offset);
65
+ AbstractValue getGepObjAddress(AbstractState& es, u32_t pointer, APOffset offset);
75
66
 
76
67
  /// Return the value range of Integer SVF Type, e.g. unsigned i8 Type->[0, 255], signed i8 Type->[-128, 127]
77
68
  AbstractValue getRangeLimitFromType(const SVFType* type);
78
69
 
79
- AbstractValue getZExtValue(const SVFVar* var);
80
- AbstractValue getSExtValue(const SVFVar* var);
81
- AbstractValue getFPToSIntValue(const SVFVar* var);
82
- AbstractValue getFPToUIntValue(const SVFVar* var);
83
- AbstractValue getSIntToFPValue(const SVFVar* var);
84
- AbstractValue getUIntToFPValue(const SVFVar* var);
85
- AbstractValue getTruncValue(const SVFVar* var, const SVFType* dstType);
86
- AbstractValue getFPTruncValue(const SVFVar* var, const SVFType* dstType);
70
+ AbstractValue getZExtValue(AbstractState& es, const SVFVar* var);
71
+ AbstractValue getSExtValue(AbstractState& es, const SVFVar* var);
72
+ AbstractValue getFPToSIntValue(AbstractState& es, const SVFVar* var);
73
+ AbstractValue getFPToUIntValue(AbstractState& es, const SVFVar* var);
74
+ AbstractValue getSIntToFPValue(AbstractState& es, const SVFVar* var);
75
+ AbstractValue getUIntToFPValue(AbstractState& es, const SVFVar* var);
76
+ AbstractValue getTruncValue(AbstractState& es, const SVFVar* var, const SVFType* dstType);
77
+ AbstractValue getFPTruncValue(AbstractState& es, const SVFVar* var, const SVFType* dstType);
87
78
 
88
79
  /// Return the byte offset expression of a GepStmt
89
80
  /// elemBytesize is the element byte size of an static alloc or heap alloc array
90
81
  /// e.g. GepStmt* gep = [i32*10], x, and x is [0,3]
91
82
  /// std::pair<s32_t, s32_t> byteOffset = getByteOffset(gep);
92
83
  /// byteOffset should be [0, 12] since i32 is 4 bytes.
93
- AbstractValue getByteOffset(const GepStmt *gep);
84
+ AbstractValue getByteOffset(AbstractState& es, const GepStmt *gep);
94
85
 
95
86
  /// Return the offset expression of a GepStmt
96
- AbstractValue getItvOfFlattenedElemIndex(const GepStmt *gep);
87
+ AbstractValue getItvOfFlattenedElemIndex(AbstractState& es, const GepStmt *gep);
97
88
 
98
89
 
99
90
  static z3::context &getContext()
@@ -105,66 +96,66 @@ public:
105
96
 
106
97
 
107
98
  /// Init ObjVar
108
- void initObjVar(const ObjVar *objVar, u32_t varId);
99
+ void initObjVar(AbstractState& es, const ObjVar *objVar, u32_t varId);
109
100
 
110
101
  /// Init SVFVar
111
- void initSVFVar(u32_t varId);
102
+ void initSVFVar(AbstractState& es, u32_t varId);
112
103
 
113
- inline AbstractValue &getAddrs(u32_t id)
104
+ inline AbstractValue &getAddrs(AbstractState& es, u32_t id)
114
105
  {
115
- if (inVarToAddrsTable(id))
116
- return _es.getAddrs(id);
106
+ if (inVarToAddrsTable(es, id))
107
+ return es.getAddrs(id);
117
108
  else
118
109
  return globalNulladdrs;
119
110
  }
120
111
 
121
112
 
122
113
  /// whether the variable is in varToVal table
123
- inline bool inVarToValTable(u32_t id) const
114
+ inline bool inVarToValTable(AbstractState& es, u32_t id) const
124
115
  {
125
- return _es.inVarToValTable(id);
116
+ return es.inVarToValTable(id);
126
117
  }
127
118
 
128
119
  /// whether the variable is in varToAddrs table
129
- inline bool inVarToAddrsTable(u32_t id) const
120
+ inline bool inVarToAddrsTable(AbstractState& es, u32_t id) const
130
121
  {
131
- return _es.inVarToAddrsTable(id);
122
+ return es.inVarToAddrsTable(id);
132
123
  }
133
124
 
134
125
 
135
126
  /// whether the memory address stores a interval value
136
- inline bool inLocToValTable(u32_t id) const
127
+ inline bool inLocToValTable(AbstractState& es, u32_t id) const
137
128
  {
138
- return _es.inLocToValTable(id);
129
+ return es.inLocToValTable(id);
139
130
  }
140
131
 
141
132
  /// whether the memory address stores memory addresses
142
- inline bool inLocToAddrsTable(u32_t id) const
133
+ inline bool inLocToAddrsTable(AbstractState& es, u32_t id) const
143
134
  {
144
- return _es.inLocToAddrsTable(id);
135
+ return es.inLocToAddrsTable(id);
145
136
  }
146
137
 
147
- void handleAddr(const AddrStmt *addr);
138
+ void handleAddr(AbstractState& es, const AddrStmt *addr);
148
139
 
149
- void handleBinary(const BinaryOPStmt *binary);
140
+ void handleBinary(AbstractState& es, const BinaryOPStmt *binary);
150
141
 
151
- void handleCmp(const CmpStmt *cmp);
142
+ void handleCmp(AbstractState& es, const CmpStmt *cmp);
152
143
 
153
- void handleLoad(const LoadStmt *load);
144
+ void handleLoad(AbstractState& es, const LoadStmt *load);
154
145
 
155
- void handleStore(const StoreStmt *store);
146
+ void handleStore(AbstractState& es, const StoreStmt *store);
156
147
 
157
- void handleCopy(const CopyStmt *copy);
148
+ void handleCopy(AbstractState& es, const CopyStmt *copy);
158
149
 
159
- void handleCall(const CallPE *callPE);
150
+ void handleCall(AbstractState& es, const CallPE *callPE);
160
151
 
161
- void handleRet(const RetPE *retPE);
152
+ void handleRet(AbstractState& es, const RetPE *retPE);
162
153
 
163
- void handleGep(const GepStmt *gep);
154
+ void handleGep(AbstractState& es, const GepStmt *gep);
164
155
 
165
- void handleSelect(const SelectStmt *select);
156
+ void handleSelect(AbstractState& es, const SelectStmt *select);
166
157
 
167
- void handlePhi(const PhiStmt *phi);
158
+ void handlePhi(AbstractState& es, const PhiStmt *phi);
168
159
 
169
160
  /// Return the internal index if idx is an address otherwise return the value of idx
170
161
  static inline u32_t getInternalID(u32_t idx)
@@ -184,29 +175,8 @@ public:
184
175
  return AbstractState::isVirtualMemAddress(val);
185
176
  }
186
177
 
187
- protected:
188
-
189
- void handleBinaryRel(const BinaryOPStmt *binary);
190
-
191
- void handleCmpRel(const CmpStmt *cmp);
192
-
193
- void handleLoadRel(const LoadStmt *load);
194
-
195
- void handleStoreRel(const StoreStmt *store);
196
-
197
- void handleCopyRel(const CopyStmt *copy);
198
-
199
- void handleCallRel(const CallPE *callPE);
200
-
201
- void handleRetRel(const RetPE *retPE);
202
-
203
- void handleSelectRel(const SelectStmt *select);
204
-
205
- void handlePhiRel(const PhiStmt *phi, const ICFGNode *srcNode, const std::vector<const ICFGEdge *> &path);
206
-
207
178
  private:
208
179
  SVFIR *_svfir;
209
- AbstractState _es;
210
180
  RelExeState _relEs;
211
181
  };
212
182
  }