svf-tools 1.0.892 → 1.0.894
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-doxygen/html/AbstractExecution_8cpp.html +3 -3
- package/SVF-doxygen/html/AbstractExecution_8cpp_source.html +1746 -1753
- package/SVF-doxygen/html/AbstractExecution_8h.html +0 -2
- package/SVF-doxygen/html/AbstractExecution_8h_source.html +284 -335
- package/SVF-doxygen/html/BufOverflowChecker_8cpp_source.html +773 -791
- package/SVF-doxygen/html/BufOverflowChecker_8h.html +0 -2
- package/SVF-doxygen/html/BufOverflowChecker_8h_source.html +48 -81
- package/SVF-doxygen/html/ae_8cpp.html +16 -19
- package/SVF-doxygen/html/ae_8cpp_source.html +16 -19
- package/SVF-doxygen/html/annotated.html +434 -436
- package/SVF-doxygen/html/classSVF_1_1AEStat.html +168 -168
- package/SVF-doxygen/html/classSVF_1_1AbstractExecution-members.html +49 -24
- package/SVF-doxygen/html/classSVF_1_1AbstractExecution.html +2533 -1041
- package/SVF-doxygen/html/classSVF_1_1BufOverflowChecker-members.html +71 -41
- package/SVF-doxygen/html/classSVF_1_1BufOverflowChecker.html +777 -63
- package/SVF-doxygen/html/classes.html +418 -421
- package/SVF-doxygen/html/functions.html +8 -12
- package/SVF-doxygen/html/functions_a.html +10 -11
- package/SVF-doxygen/html/functions_b.html +5 -9
- package/SVF-doxygen/html/functions_c.html +26 -28
- package/SVF-doxygen/html/functions_d.html +2 -2
- package/SVF-doxygen/html/functions_e.html +2 -2
- package/SVF-doxygen/html/functions_enum.html +1 -1
- package/SVF-doxygen/html/functions_eval_m.html +2 -2
- package/SVF-doxygen/html/functions_eval_s.html +2 -2
- package/SVF-doxygen/html/functions_eval_u.html +1 -1
- package/SVF-doxygen/html/functions_func.html +9 -12
- package/SVF-doxygen/html/functions_func_b.html +2 -5
- package/SVF-doxygen/html/functions_func_c.html +25 -27
- package/SVF-doxygen/html/functions_func_d.html +2 -2
- package/SVF-doxygen/html/functions_func_g.html +15 -16
- package/SVF-doxygen/html/functions_func_h.html +6 -6
- package/SVF-doxygen/html/functions_func_i.html +9 -13
- package/SVF-doxygen/html/functions_func_p.html +1 -1
- package/SVF-doxygen/html/functions_func_s.html +19 -20
- package/SVF-doxygen/html/functions_func_t.html +1 -1
- package/SVF-doxygen/html/functions_func_~.html +0 -3
- package/SVF-doxygen/html/functions_g.html +21 -22
- package/SVF-doxygen/html/functions_h.html +6 -6
- package/SVF-doxygen/html/functions_i.html +15 -19
- package/SVF-doxygen/html/functions_l.html +5 -5
- package/SVF-doxygen/html/functions_m.html +2 -2
- package/SVF-doxygen/html/functions_o.html +15 -15
- package/SVF-doxygen/html/functions_p.html +13 -13
- package/SVF-doxygen/html/functions_r.html +4 -2
- package/SVF-doxygen/html/functions_s.html +21 -22
- package/SVF-doxygen/html/functions_t.html +5 -5
- package/SVF-doxygen/html/functions_type_c.html +1 -1
- package/SVF-doxygen/html/functions_u.html +1 -1
- package/SVF-doxygen/html/functions_vars.html +8 -12
- package/SVF-doxygen/html/functions_vars_b.html +0 -3
- package/SVF-doxygen/html/functions_w.html +7 -13
- package/SVF-doxygen/html/functions_~.html +0 -3
- package/SVF-doxygen/html/hierarchy.html +629 -631
- package/SVF-doxygen/html/namespaceSVF.html +5 -9
- package/SVF-doxygen/html/search/all_0.js +11 -11
- package/SVF-doxygen/html/search/all_1.js +5 -5
- package/SVF-doxygen/html/search/all_10.js +325 -325
- package/SVF-doxygen/html/search/all_11.js +226 -226
- package/SVF-doxygen/html/search/all_12.js +570 -570
- package/SVF-doxygen/html/search/all_13.js +207 -207
- package/SVF-doxygen/html/search/all_14.js +70 -70
- package/SVF-doxygen/html/search/all_15.js +176 -176
- package/SVF-doxygen/html/search/all_16.js +77 -77
- package/SVF-doxygen/html/search/all_17.js +1 -1
- package/SVF-doxygen/html/search/all_18.js +1 -1
- package/SVF-doxygen/html/search/all_19.js +26 -26
- package/SVF-doxygen/html/search/all_1a.js +179 -180
- package/SVF-doxygen/html/search/all_2.js +65 -66
- package/SVF-doxygen/html/search/all_3.js +640 -640
- package/SVF-doxygen/html/search/all_4.js +235 -235
- package/SVF-doxygen/html/search/all_5.js +126 -126
- package/SVF-doxygen/html/search/all_6.js +232 -232
- package/SVF-doxygen/html/search/all_7.js +1047 -1047
- package/SVF-doxygen/html/search/all_8.js +215 -215
- package/SVF-doxygen/html/search/all_9.js +629 -630
- package/SVF-doxygen/html/search/all_a.js +46 -46
- package/SVF-doxygen/html/search/all_b.js +26 -26
- package/SVF-doxygen/html/search/all_c.js +115 -115
- package/SVF-doxygen/html/search/all_d.js +204 -204
- package/SVF-doxygen/html/search/all_e.js +209 -209
- package/SVF-doxygen/html/search/all_f.js +122 -122
- package/SVF-doxygen/html/search/classes_0.js +28 -29
- package/SVF-doxygen/html/search/classes_1.js +11 -12
- package/SVF-doxygen/html/search/classes_10.js +74 -74
- package/SVF-doxygen/html/search/classes_11.js +14 -14
- package/SVF-doxygen/html/search/classes_12.js +2 -2
- package/SVF-doxygen/html/search/classes_13.js +10 -10
- package/SVF-doxygen/html/search/classes_14.js +19 -19
- package/SVF-doxygen/html/search/classes_15.js +1 -1
- package/SVF-doxygen/html/search/classes_2.js +73 -73
- package/SVF-doxygen/html/search/classes_3.js +35 -35
- package/SVF-doxygen/html/search/classes_4.js +8 -8
- package/SVF-doxygen/html/search/classes_5.js +28 -28
- package/SVF-doxygen/html/search/classes_6.js +98 -98
- package/SVF-doxygen/html/search/classes_7.js +38 -38
- package/SVF-doxygen/html/search/classes_8.js +59 -59
- package/SVF-doxygen/html/search/classes_9.js +1 -1
- package/SVF-doxygen/html/search/classes_a.js +12 -12
- package/SVF-doxygen/html/search/classes_b.js +29 -29
- package/SVF-doxygen/html/search/classes_c.js +6 -6
- package/SVF-doxygen/html/search/classes_d.js +19 -19
- package/SVF-doxygen/html/search/classes_e.js +36 -36
- package/SVF-doxygen/html/search/classes_f.js +25 -25
- package/SVF-doxygen/html/search/defines_0.js +3 -3
- package/SVF-doxygen/html/search/defines_1.js +3 -3
- package/SVF-doxygen/html/search/defines_10.js +2 -2
- package/SVF-doxygen/html/search/defines_2.js +30 -30
- package/SVF-doxygen/html/search/defines_3.js +20 -20
- package/SVF-doxygen/html/search/defines_4.js +3 -3
- package/SVF-doxygen/html/search/defines_5.js +4 -4
- package/SVF-doxygen/html/search/defines_6.js +2 -2
- package/SVF-doxygen/html/search/defines_7.js +5 -5
- package/SVF-doxygen/html/search/defines_8.js +11 -11
- package/SVF-doxygen/html/search/defines_9.js +9 -9
- package/SVF-doxygen/html/search/defines_a.js +2 -2
- package/SVF-doxygen/html/search/defines_b.js +1 -1
- package/SVF-doxygen/html/search/defines_c.js +4 -4
- package/SVF-doxygen/html/search/defines_d.js +2 -2
- package/SVF-doxygen/html/search/defines_e.js +8 -8
- package/SVF-doxygen/html/search/defines_f.js +4 -4
- package/SVF-doxygen/html/search/enums_0.js +4 -4
- package/SVF-doxygen/html/search/enums_1.js +2 -2
- package/SVF-doxygen/html/search/enums_10.js +1 -1
- package/SVF-doxygen/html/search/enums_11.js +1 -1
- package/SVF-doxygen/html/search/enums_2.js +8 -8
- package/SVF-doxygen/html/search/enums_3.js +1 -1
- package/SVF-doxygen/html/search/enums_4.js +4 -4
- package/SVF-doxygen/html/search/enums_5.js +1 -1
- package/SVF-doxygen/html/search/enums_6.js +2 -2
- package/SVF-doxygen/html/search/enums_7.js +2 -2
- package/SVF-doxygen/html/search/enums_8.js +4 -4
- package/SVF-doxygen/html/search/enums_9.js +1 -1
- package/SVF-doxygen/html/search/enums_a.js +1 -1
- package/SVF-doxygen/html/search/enums_b.js +7 -7
- package/SVF-doxygen/html/search/enums_c.js +1 -1
- package/SVF-doxygen/html/search/enums_d.js +4 -4
- package/SVF-doxygen/html/search/enums_e.js +2 -2
- package/SVF-doxygen/html/search/enums_f.js +4 -4
- package/SVF-doxygen/html/search/enumvalues_0.js +15 -15
- package/SVF-doxygen/html/search/enumvalues_1.js +15 -15
- package/SVF-doxygen/html/search/enumvalues_10.js +35 -35
- package/SVF-doxygen/html/search/enumvalues_11.js +4 -4
- package/SVF-doxygen/html/search/enumvalues_12.js +10 -10
- package/SVF-doxygen/html/search/enumvalues_13.js +1 -1
- package/SVF-doxygen/html/search/enumvalues_14.js +1 -1
- package/SVF-doxygen/html/search/enumvalues_15.js +3 -3
- package/SVF-doxygen/html/search/enumvalues_2.js +36 -36
- package/SVF-doxygen/html/search/enumvalues_3.js +13 -13
- package/SVF-doxygen/html/search/enumvalues_4.js +2 -2
- package/SVF-doxygen/html/search/enumvalues_5.js +47 -47
- package/SVF-doxygen/html/search/enumvalues_6.js +6 -6
- package/SVF-doxygen/html/search/enumvalues_7.js +8 -8
- package/SVF-doxygen/html/search/enumvalues_8.js +23 -23
- package/SVF-doxygen/html/search/enumvalues_9.js +6 -6
- package/SVF-doxygen/html/search/enumvalues_a.js +17 -17
- package/SVF-doxygen/html/search/enumvalues_b.js +11 -11
- package/SVF-doxygen/html/search/enumvalues_c.js +5 -5
- package/SVF-doxygen/html/search/enumvalues_d.js +18 -18
- package/SVF-doxygen/html/search/enumvalues_e.js +9 -9
- package/SVF-doxygen/html/search/enumvalues_f.js +47 -47
- package/SVF-doxygen/html/search/files_0.js +16 -16
- package/SVF-doxygen/html/search/files_1.js +9 -9
- package/SVF-doxygen/html/search/files_10.js +8 -8
- package/SVF-doxygen/html/search/files_11.js +8 -8
- package/SVF-doxygen/html/search/files_12.js +2 -2
- package/SVF-doxygen/html/search/files_2.js +53 -53
- package/SVF-doxygen/html/search/files_3.js +14 -14
- package/SVF-doxygen/html/search/files_4.js +5 -5
- package/SVF-doxygen/html/search/files_5.js +13 -13
- package/SVF-doxygen/html/search/files_6.js +10 -10
- package/SVF-doxygen/html/search/files_7.js +17 -17
- package/SVF-doxygen/html/search/files_8.js +13 -13
- package/SVF-doxygen/html/search/files_9.js +18 -18
- package/SVF-doxygen/html/search/files_a.js +3 -3
- package/SVF-doxygen/html/search/files_b.js +4 -4
- package/SVF-doxygen/html/search/files_c.js +20 -20
- package/SVF-doxygen/html/search/files_d.js +4 -4
- package/SVF-doxygen/html/search/files_e.js +62 -62
- package/SVF-doxygen/html/search/files_f.js +8 -8
- package/SVF-doxygen/html/search/functions_0.js +13 -13
- package/SVF-doxygen/html/search/functions_1.js +368 -369
- package/SVF-doxygen/html/search/functions_10.js +140 -140
- package/SVF-doxygen/html/search/functions_11.js +140 -140
- package/SVF-doxygen/html/search/functions_12.js +299 -299
- package/SVF-doxygen/html/search/functions_13.js +73 -73
- package/SVF-doxygen/html/search/functions_14.js +41 -41
- package/SVF-doxygen/html/search/functions_15.js +72 -72
- package/SVF-doxygen/html/search/functions_16.js +38 -38
- package/SVF-doxygen/html/search/functions_17.js +3 -3
- package/SVF-doxygen/html/search/functions_18.js +179 -180
- package/SVF-doxygen/html/search/functions_2.js +94 -95
- package/SVF-doxygen/html/search/functions_3.js +261 -261
- package/SVF-doxygen/html/search/functions_4.js +84 -84
- package/SVF-doxygen/html/search/functions_5.js +57 -57
- package/SVF-doxygen/html/search/functions_6.js +65 -65
- package/SVF-doxygen/html/search/functions_7.js +863 -863
- package/SVF-doxygen/html/search/functions_8.js +162 -162
- package/SVF-doxygen/html/search/functions_9.js +438 -439
- package/SVF-doxygen/html/search/functions_a.js +30 -30
- package/SVF-doxygen/html/search/functions_b.js +2 -2
- package/SVF-doxygen/html/search/functions_c.js +25 -25
- package/SVF-doxygen/html/search/functions_d.js +82 -82
- package/SVF-doxygen/html/search/functions_e.js +36 -36
- package/SVF-doxygen/html/search/functions_f.js +58 -58
- package/SVF-doxygen/html/search/namespaces_0.js +1 -1
- package/SVF-doxygen/html/search/namespaces_1.js +7 -7
- package/SVF-doxygen/html/search/related_0.js +4 -4
- package/SVF-doxygen/html/search/related_1.js +2 -2
- package/SVF-doxygen/html/search/related_2.js +2 -2
- package/SVF-doxygen/html/search/related_3.js +2 -2
- package/SVF-doxygen/html/search/related_4.js +2 -2
- package/SVF-doxygen/html/search/related_5.js +1 -1
- package/SVF-doxygen/html/search/related_6.js +2 -2
- package/SVF-doxygen/html/search/related_7.js +5 -5
- package/SVF-doxygen/html/search/related_8.js +2 -2
- package/SVF-doxygen/html/search/related_9.js +4 -4
- package/SVF-doxygen/html/search/related_a.js +19 -19
- package/SVF-doxygen/html/search/related_b.js +4 -4
- package/SVF-doxygen/html/search/related_c.js +2 -2
- package/SVF-doxygen/html/search/related_d.js +12 -12
- package/SVF-doxygen/html/search/related_e.js +2 -2
- package/SVF-doxygen/html/search/related_f.js +2 -2
- package/SVF-doxygen/html/search/typedefs_0.js +19 -19
- package/SVF-doxygen/html/search/typedefs_1.js +27 -27
- package/SVF-doxygen/html/search/typedefs_10.js +63 -63
- package/SVF-doxygen/html/search/typedefs_11.js +13 -13
- package/SVF-doxygen/html/search/typedefs_12.js +11 -11
- package/SVF-doxygen/html/search/typedefs_13.js +40 -40
- package/SVF-doxygen/html/search/typedefs_14.js +11 -11
- package/SVF-doxygen/html/search/typedefs_2.js +125 -125
- package/SVF-doxygen/html/search/typedefs_3.js +39 -39
- package/SVF-doxygen/html/search/typedefs_4.js +17 -17
- package/SVF-doxygen/html/search/typedefs_5.js +42 -42
- package/SVF-doxygen/html/search/typedefs_6.js +54 -54
- package/SVF-doxygen/html/search/typedefs_7.js +47 -47
- package/SVF-doxygen/html/search/typedefs_8.js +1 -1
- package/SVF-doxygen/html/search/typedefs_9.js +6 -6
- package/SVF-doxygen/html/search/typedefs_a.js +29 -29
- package/SVF-doxygen/html/search/typedefs_b.js +29 -29
- package/SVF-doxygen/html/search/typedefs_c.js +41 -41
- package/SVF-doxygen/html/search/typedefs_d.js +15 -15
- package/SVF-doxygen/html/search/typedefs_e.js +52 -52
- package/SVF-doxygen/html/search/typedefs_f.js +14 -14
- package/SVF-doxygen/html/search/variables_0.js +177 -177
- package/SVF-doxygen/html/search/variables_1.js +76 -76
- package/SVF-doxygen/html/search/variables_10.js +98 -98
- package/SVF-doxygen/html/search/variables_11.js +46 -46
- package/SVF-doxygen/html/search/variables_12.js +93 -93
- package/SVF-doxygen/html/search/variables_13.js +76 -76
- package/SVF-doxygen/html/search/variables_14.js +14 -14
- package/SVF-doxygen/html/search/variables_15.js +49 -49
- package/SVF-doxygen/html/search/variables_16.js +11 -11
- package/SVF-doxygen/html/search/variables_17.js +1 -1
- package/SVF-doxygen/html/search/variables_18.js +17 -17
- package/SVF-doxygen/html/search/variables_2.js +40 -41
- package/SVF-doxygen/html/search/variables_3.js +142 -142
- package/SVF-doxygen/html/search/variables_4.js +51 -51
- package/SVF-doxygen/html/search/variables_5.js +39 -39
- package/SVF-doxygen/html/search/variables_6.js +66 -66
- package/SVF-doxygen/html/search/variables_7.js +34 -34
- package/SVF-doxygen/html/search/variables_8.js +8 -8
- package/SVF-doxygen/html/search/variables_9.js +79 -79
- package/SVF-doxygen/html/search/variables_a.js +4 -4
- package/SVF-doxygen/html/search/variables_b.js +10 -10
- package/SVF-doxygen/html/search/variables_c.js +45 -45
- package/SVF-doxygen/html/search/variables_d.js +57 -57
- package/SVF-doxygen/html/search/variables_e.js +123 -123
- package/SVF-doxygen/html/search/variables_f.js +31 -31
- package/package.json +1 -1
- package/setup.sh +1 -1
- package/svf/include/AE/Svfexe/AbstractExecution.h +55 -102
- package/svf/include/AE/Svfexe/BufOverflowChecker.h +12 -33
- package/svf/lib/AE/Svfexe/AbstractExecution.cpp +59 -64
- package/svf/lib/AE/Svfexe/BufOverflowChecker.cpp +44 -59
- package/svf-llvm/tools/AE/ae.cpp +1 -2
|
@@ -83,10 +83,6 @@ Map<s32_t, s32_t> _switch_lhsrhs_predicate =
|
|
|
83
83
|
{CmpStmt::Predicate::ICMP_SGE, CmpStmt::Predicate::ICMP_SLE}, // >= -> <=
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
void AbstractExecution::initExtAPI()
|
|
87
|
-
{
|
|
88
|
-
_api = new AEAPI(this, _stat);
|
|
89
|
-
}
|
|
90
86
|
|
|
91
87
|
void AbstractExecution::runOnModule(ICFG *icfg)
|
|
92
88
|
{
|
|
@@ -95,7 +91,6 @@ void AbstractExecution::runOnModule(ICFG *icfg)
|
|
|
95
91
|
_icfg = icfg;
|
|
96
92
|
_svfir = PAG::getPAG();
|
|
97
93
|
_ander = AndersenWaveDiff::createAndersenWaveDiff(_svfir);
|
|
98
|
-
_api->setModule(_svfir);
|
|
99
94
|
// init SVF Execution States
|
|
100
95
|
_svfir2ExeState = new SVFIR2ItvExeState(_svfir);
|
|
101
96
|
|
|
@@ -103,7 +98,7 @@ void AbstractExecution::runOnModule(ICFG *icfg)
|
|
|
103
98
|
_callgraph = _ander->getPTACallGraph();
|
|
104
99
|
|
|
105
100
|
/// collect checkpoint
|
|
106
|
-
|
|
101
|
+
collectCheckPoint();
|
|
107
102
|
|
|
108
103
|
/// if function contains callInst that call itself, it is a recursive function.
|
|
109
104
|
markRecursiveFuns();
|
|
@@ -114,7 +109,7 @@ void AbstractExecution::runOnModule(ICFG *icfg)
|
|
|
114
109
|
_funcToWTO[fun] = wto;
|
|
115
110
|
}
|
|
116
111
|
analyse();
|
|
117
|
-
|
|
112
|
+
checkPointAllSet();
|
|
118
113
|
// 5. Stop clock and report bugs
|
|
119
114
|
_stat->endClk();
|
|
120
115
|
_stat->finializeStat();
|
|
@@ -128,12 +123,12 @@ void AbstractExecution::runOnModule(ICFG *icfg)
|
|
|
128
123
|
AbstractExecution::AbstractExecution()
|
|
129
124
|
{
|
|
130
125
|
_stat = new AEStat(this);
|
|
126
|
+
initExtFunMap();
|
|
131
127
|
}
|
|
132
128
|
/// Destructor
|
|
133
129
|
AbstractExecution::~AbstractExecution()
|
|
134
130
|
{
|
|
135
131
|
delete _stat;
|
|
136
|
-
delete _api;
|
|
137
132
|
delete _svfir2ExeState;
|
|
138
133
|
for (auto it: _funcToWTO)
|
|
139
134
|
delete it.second;
|
|
@@ -650,7 +645,7 @@ bool AbstractExecution::isExtCall(const SVF::CallICFGNode *callNode)
|
|
|
650
645
|
void AbstractExecution::extCallPass(const SVF::CallICFGNode *callNode)
|
|
651
646
|
{
|
|
652
647
|
_callSiteStack.push_back(callNode);
|
|
653
|
-
|
|
648
|
+
handleExtAPI(callNode);
|
|
654
649
|
_callSiteStack.pop_back();
|
|
655
650
|
}
|
|
656
651
|
|
|
@@ -1136,18 +1131,18 @@ void AEStat::reportBug()
|
|
|
1136
1131
|
}
|
|
1137
1132
|
}
|
|
1138
1133
|
|
|
1139
|
-
void
|
|
1134
|
+
void AbstractExecution::initExtFunMap()
|
|
1140
1135
|
{
|
|
1141
1136
|
#define SSE_FUNC_PROCESS(LLVM_NAME ,FUNC_NAME) \
|
|
1142
1137
|
auto sse_##FUNC_NAME = [this](const CallSite &cs) { \
|
|
1143
1138
|
/* run real ext function */ \
|
|
1144
|
-
IntervalExeState &es =
|
|
1139
|
+
IntervalExeState &es = _svfir2ExeState->getEs(); \
|
|
1145
1140
|
u32_t rhs_id = _svfir->getValueNode(cs.getArgument(0)); \
|
|
1146
1141
|
if (!es.inVarToValTable(rhs_id)) return; \
|
|
1147
|
-
u32_t rhs =
|
|
1142
|
+
u32_t rhs = _svfir2ExeState->getEs()[rhs_id].lb().getNumeral(); \
|
|
1148
1143
|
s32_t res = FUNC_NAME(rhs); \
|
|
1149
1144
|
u32_t lhsId = _svfir->getValueNode(cs.getInstruction()); \
|
|
1150
|
-
|
|
1145
|
+
_svfir2ExeState->getEs()[lhsId] = IntervalValue(res); \
|
|
1151
1146
|
return; \
|
|
1152
1147
|
}; \
|
|
1153
1148
|
_func_map[#FUNC_NAME] = sse_##FUNC_NAME; \
|
|
@@ -1176,7 +1171,7 @@ void AEAPI::initExtFunMap()
|
|
|
1176
1171
|
const CallICFGNode* callNode = SVFUtil::dyn_cast<CallICFGNode>(_svfir->getICFG()->getICFGNode(cs.getInstruction()));
|
|
1177
1172
|
_checkpoints.erase(callNode);
|
|
1178
1173
|
u32_t arg0 = _svfir->getValueNode(cs.getArgument(0));
|
|
1179
|
-
IntervalExeState &es =
|
|
1174
|
+
IntervalExeState &es = _svfir2ExeState->getEs();
|
|
1180
1175
|
es[arg0].meet_with(IntervalValue(1, 1));
|
|
1181
1176
|
if (es[arg0].equals(IntervalValue(1, 1)))
|
|
1182
1177
|
{
|
|
@@ -1194,7 +1189,7 @@ void AEAPI::initExtFunMap()
|
|
|
1194
1189
|
auto svf_print = [&](const CallSite &cs)
|
|
1195
1190
|
{
|
|
1196
1191
|
if (cs.arg_size() < 2) return;
|
|
1197
|
-
IntervalExeState &es =
|
|
1192
|
+
IntervalExeState &es = _svfir2ExeState->getEs();
|
|
1198
1193
|
u32_t num_id = _svfir->getValueNode(cs.getArgument(0));
|
|
1199
1194
|
std::string text = strRead(cs.getArgument(1));
|
|
1200
1195
|
assert(es.inVarToValTable(num_id) && "print() should pass integer");
|
|
@@ -1208,17 +1203,17 @@ void AEAPI::initExtFunMap()
|
|
|
1208
1203
|
_checkpoint_names.insert("svf_assert");
|
|
1209
1204
|
};
|
|
1210
1205
|
|
|
1211
|
-
std::string
|
|
1206
|
+
std::string AbstractExecution::strRead(const SVFValue* rhs)
|
|
1212
1207
|
{
|
|
1213
1208
|
// sse read string nodeID->string
|
|
1214
|
-
IntervalExeState &es =
|
|
1209
|
+
IntervalExeState &es = _svfir2ExeState->getEs();
|
|
1215
1210
|
std::string str0;
|
|
1216
1211
|
|
|
1217
1212
|
for (u32_t index = 0; index < Options::MaxFieldLimit(); index++)
|
|
1218
1213
|
{
|
|
1219
1214
|
// dead loop for string and break if there's a \0. If no \0, it will throw err.
|
|
1220
1215
|
if (!es.inVarToAddrsTable(_svfir->getValueNode(rhs))) continue;
|
|
1221
|
-
ExeState::Addrs expr0 =
|
|
1216
|
+
ExeState::Addrs expr0 = _svfir2ExeState->getGepObjAddress(_svfir->getValueNode(rhs), index);
|
|
1222
1217
|
IntervalValue val = IntervalValue::bottom();
|
|
1223
1218
|
for (const auto &addr: expr0)
|
|
1224
1219
|
{
|
|
@@ -1237,7 +1232,7 @@ std::string AEAPI::strRead(const SVFValue* rhs)
|
|
|
1237
1232
|
return str0;
|
|
1238
1233
|
}
|
|
1239
1234
|
|
|
1240
|
-
void
|
|
1235
|
+
void AbstractExecution::handleExtAPI(const CallICFGNode *call)
|
|
1241
1236
|
{
|
|
1242
1237
|
const SVFFunction *fun = SVFUtil::getCallee(call->getCallSite());
|
|
1243
1238
|
assert(fun && "SVFFunction* is nullptr");
|
|
@@ -1264,13 +1259,13 @@ void AEAPI::handleExtAPI(const CallICFGNode *call)
|
|
|
1264
1259
|
else
|
|
1265
1260
|
{
|
|
1266
1261
|
u32_t lhsId = _svfir->getValueNode(SVFUtil::getSVFCallSite(call->getCallSite()).getInstruction());
|
|
1267
|
-
if (
|
|
1262
|
+
if (_svfir2ExeState->getEs().inVarToAddrsTable(lhsId))
|
|
1268
1263
|
{
|
|
1269
1264
|
|
|
1270
1265
|
}
|
|
1271
1266
|
else
|
|
1272
1267
|
{
|
|
1273
|
-
|
|
1268
|
+
_svfir2ExeState->getEs()[lhsId] = IntervalValue();
|
|
1274
1269
|
}
|
|
1275
1270
|
return;
|
|
1276
1271
|
}
|
|
@@ -1278,14 +1273,14 @@ void AEAPI::handleExtAPI(const CallICFGNode *call)
|
|
|
1278
1273
|
// 1. memcpy functions like memcpy_chk, strncpy, annotate("MEMCPY"), annotate("BUF_CHECK:Arg0, Arg2"), annotate("BUF_CHECK:Arg1, Arg2")
|
|
1279
1274
|
else if (extType == MEMCPY)
|
|
1280
1275
|
{
|
|
1281
|
-
IntervalValue len =
|
|
1276
|
+
IntervalValue len = _svfir2ExeState->getEs()[_svfir->getValueNode(cs.getArgument(2))];
|
|
1282
1277
|
handleMemcpy(cs.getArgument(0), cs.getArgument(1), len, 0);
|
|
1283
1278
|
}
|
|
1284
1279
|
else if (extType == MEMSET)
|
|
1285
1280
|
{
|
|
1286
1281
|
// memset dst is arg0, elem is arg1, size is arg2
|
|
1287
|
-
IntervalValue len =
|
|
1288
|
-
IntervalValue elem =
|
|
1282
|
+
IntervalValue len = _svfir2ExeState->getEs()[_svfir->getValueNode(cs.getArgument(2))];
|
|
1283
|
+
IntervalValue elem = _svfir2ExeState->getEs()[_svfir->getValueNode(cs.getArgument(1))];
|
|
1289
1284
|
handleMemset(cs.getArgument(0), elem, len);
|
|
1290
1285
|
}
|
|
1291
1286
|
else if (extType == STRCPY)
|
|
@@ -1303,10 +1298,10 @@ void AEAPI::handleExtAPI(const CallICFGNode *call)
|
|
|
1303
1298
|
return;
|
|
1304
1299
|
}
|
|
1305
1300
|
|
|
1306
|
-
void
|
|
1301
|
+
void AbstractExecution::collectCheckPoint()
|
|
1307
1302
|
{
|
|
1308
1303
|
// traverse every ICFGNode
|
|
1309
|
-
for (auto it =
|
|
1304
|
+
for (auto it = _svfir->getICFG()->begin(); it != _svfir->getICFG()->end(); ++it)
|
|
1310
1305
|
{
|
|
1311
1306
|
const ICFGNode* node = it->second;
|
|
1312
1307
|
if (const CallICFGNode *call = SVFUtil::dyn_cast<CallICFGNode>(node))
|
|
@@ -1322,7 +1317,7 @@ void AEAPI::collectCheckPoint()
|
|
|
1322
1317
|
}
|
|
1323
1318
|
}
|
|
1324
1319
|
|
|
1325
|
-
void
|
|
1320
|
+
void AbstractExecution::checkPointAllSet()
|
|
1326
1321
|
{
|
|
1327
1322
|
if (_checkpoints.size() == 0)
|
|
1328
1323
|
{
|
|
@@ -1341,7 +1336,7 @@ void AEAPI::checkPointAllSet()
|
|
|
1341
1336
|
}
|
|
1342
1337
|
|
|
1343
1338
|
|
|
1344
|
-
void
|
|
1339
|
+
void AbstractExecution::handleStrcpy(const CallICFGNode *call)
|
|
1345
1340
|
{
|
|
1346
1341
|
// strcpy, __strcpy_chk, stpcpy , wcscpy, __wcscpy_chk
|
|
1347
1342
|
// get the dst and src
|
|
@@ -1353,7 +1348,7 @@ void AEAPI::handleStrcpy(const CallICFGNode *call)
|
|
|
1353
1348
|
handleMemcpy(arg0Val, arg1Val, strLen,strLen.lb().getNumeral());
|
|
1354
1349
|
}
|
|
1355
1350
|
|
|
1356
|
-
u32_t
|
|
1351
|
+
u32_t AbstractExecution::getAllocaInstByteSize(const AddrStmt *addr)
|
|
1357
1352
|
{
|
|
1358
1353
|
if (const ObjVar* objvar = SVFUtil::dyn_cast<ObjVar>(addr->getRHSVar()))
|
|
1359
1354
|
{
|
|
@@ -1372,11 +1367,11 @@ u32_t AEAPI::getAllocaInstByteSize(const AddrStmt *addr)
|
|
|
1372
1367
|
u64_t res = elementSize;
|
|
1373
1368
|
for (const SVFValue* value: sizes)
|
|
1374
1369
|
{
|
|
1375
|
-
if (!
|
|
1370
|
+
if (!_svfir2ExeState->inVarToValTable(_svfir->getValueNode(value)))
|
|
1376
1371
|
{
|
|
1377
|
-
|
|
1372
|
+
_svfir2ExeState->getEs()[_svfir->getValueNode(value)] = IntervalValue(Options::MaxFieldLimit());
|
|
1378
1373
|
}
|
|
1379
|
-
IntervalValue itv =
|
|
1374
|
+
IntervalValue itv = _svfir2ExeState->getEs()[_svfir->getValueNode(value)];
|
|
1380
1375
|
res = res * itv.ub().getNumeral() > Options::MaxFieldLimit()? Options::MaxFieldLimit(): res * itv.ub().getNumeral();
|
|
1381
1376
|
}
|
|
1382
1377
|
return (u32_t)res;
|
|
@@ -1386,7 +1381,7 @@ u32_t AEAPI::getAllocaInstByteSize(const AddrStmt *addr)
|
|
|
1386
1381
|
abort();
|
|
1387
1382
|
}
|
|
1388
1383
|
|
|
1389
|
-
IntervalValue
|
|
1384
|
+
IntervalValue AbstractExecution::traceMemoryAllocationSize(const SVFValue *value)
|
|
1390
1385
|
{
|
|
1391
1386
|
/// Usually called by a GepStmt overflow check, or external API (like memcpy) overflow check
|
|
1392
1387
|
/// Defitions of Terms:
|
|
@@ -1467,7 +1462,7 @@ IntervalValue AEAPI::traceMemoryAllocationSize(const SVFValue *value)
|
|
|
1467
1462
|
}
|
|
1468
1463
|
else
|
|
1469
1464
|
{
|
|
1470
|
-
IntervalValue byteOffset =
|
|
1465
|
+
IntervalValue byteOffset = _svfir2ExeState->getByteOffset(gep);
|
|
1471
1466
|
}
|
|
1472
1467
|
// for variable offset, join with accumulate gep offset
|
|
1473
1468
|
gep_offsets[gep->getICFGNode()] = byteOffset;
|
|
@@ -1518,18 +1513,18 @@ IntervalValue AEAPI::traceMemoryAllocationSize(const SVFValue *value)
|
|
|
1518
1513
|
}
|
|
1519
1514
|
|
|
1520
1515
|
|
|
1521
|
-
IntervalValue
|
|
1516
|
+
IntervalValue AbstractExecution::getStrlen(const SVF::SVFValue *strValue)
|
|
1522
1517
|
{
|
|
1523
|
-
IntervalExeState &es =
|
|
1518
|
+
IntervalExeState &es = _svfir2ExeState->getEs();
|
|
1524
1519
|
IntervalValue dst_size = traceMemoryAllocationSize(strValue);
|
|
1525
1520
|
u32_t len = 0;
|
|
1526
1521
|
NodeID dstid = _svfir->getValueNode(strValue);
|
|
1527
1522
|
u32_t elemSize = 1;
|
|
1528
|
-
if (
|
|
1523
|
+
if (_svfir2ExeState->inVarToAddrsTable(dstid))
|
|
1529
1524
|
{
|
|
1530
1525
|
for (u32_t index = 0; index < dst_size.lb().getNumeral(); index++)
|
|
1531
1526
|
{
|
|
1532
|
-
ExeState::Addrs expr0 =
|
|
1527
|
+
ExeState::Addrs expr0 = _svfir2ExeState->getGepObjAddress(dstid, index);
|
|
1533
1528
|
IntervalValue val = IntervalValue::bottom();
|
|
1534
1529
|
for (const auto &addr: expr0)
|
|
1535
1530
|
{
|
|
@@ -1572,7 +1567,7 @@ IntervalValue AEAPI::getStrlen(const SVF::SVFValue *strValue)
|
|
|
1572
1567
|
}
|
|
1573
1568
|
|
|
1574
1569
|
|
|
1575
|
-
void
|
|
1570
|
+
void AbstractExecution::handleStrcat(const SVF::CallICFGNode *call)
|
|
1576
1571
|
{
|
|
1577
1572
|
// __strcat_chk, strcat, __wcscat_chk, wcscat, __strncat_chk, strncat, __wcsncat_chk, wcsncat
|
|
1578
1573
|
// to check it is strcat group or strncat group
|
|
@@ -1596,7 +1591,7 @@ void AEAPI::handleStrcat(const SVF::CallICFGNode *call)
|
|
|
1596
1591
|
const SVFValue* arg0Val = cs.getArgument(0);
|
|
1597
1592
|
const SVFValue* arg1Val = cs.getArgument(1);
|
|
1598
1593
|
const SVFValue* arg2Val = cs.getArgument(2);
|
|
1599
|
-
IntervalValue arg2Num =
|
|
1594
|
+
IntervalValue arg2Num = _svfir2ExeState->getEs()[_svfir->getValueNode(arg2Val)];
|
|
1600
1595
|
IntervalValue strLen0 = getStrlen(arg0Val);
|
|
1601
1596
|
IntervalValue totalLen = strLen0 + arg2Num;
|
|
1602
1597
|
handleMemcpy(arg0Val, arg1Val, arg2Num, strLen0.lb().getNumeral());
|
|
@@ -1608,9 +1603,9 @@ void AEAPI::handleStrcat(const SVF::CallICFGNode *call)
|
|
|
1608
1603
|
}
|
|
1609
1604
|
}
|
|
1610
1605
|
|
|
1611
|
-
void
|
|
1606
|
+
void AbstractExecution::handleMemcpy(const SVF::SVFValue *dst, const SVF::SVFValue *src, SVF::IntervalValue len, u32_t start_idx)
|
|
1612
1607
|
{
|
|
1613
|
-
IntervalExeState &es =
|
|
1608
|
+
IntervalExeState &es = _svfir2ExeState->getEs();
|
|
1614
1609
|
u32_t dstId = _svfir->getValueNode(dst); // pts(dstId) = {objid} objbar objtypeinfo->getType().
|
|
1615
1610
|
u32_t srcId = _svfir->getValueNode(src);
|
|
1616
1611
|
u32_t elemSize = 1;
|
|
@@ -1639,13 +1634,13 @@ void AEAPI::handleMemcpy(const SVF::SVFValue *dst, const SVF::SVFValue *src, SVF
|
|
|
1639
1634
|
}
|
|
1640
1635
|
u32_t size = std::min((u32_t)Options::MaxFieldLimit(), (u32_t) len.lb().getNumeral());
|
|
1641
1636
|
u32_t range_val = size / elemSize;
|
|
1642
|
-
if (
|
|
1637
|
+
if (_svfir2ExeState->inVarToAddrsTable(srcId) && _svfir2ExeState->inVarToAddrsTable(dstId))
|
|
1643
1638
|
{
|
|
1644
1639
|
for (u32_t index = 0; index < range_val; index++)
|
|
1645
1640
|
{
|
|
1646
1641
|
// dead loop for string and break if there's a \0. If no \0, it will throw err.
|
|
1647
|
-
ExeState::Addrs expr_src =
|
|
1648
|
-
ExeState::Addrs expr_dst =
|
|
1642
|
+
ExeState::Addrs expr_src = _svfir2ExeState->getGepObjAddress(srcId, index);
|
|
1643
|
+
ExeState::Addrs expr_dst = _svfir2ExeState->getGepObjAddress(dstId, index + start_idx);
|
|
1649
1644
|
for (const auto &dst: expr_dst)
|
|
1650
1645
|
{
|
|
1651
1646
|
for (const auto &src: expr_src)
|
|
@@ -1665,15 +1660,15 @@ void AEAPI::handleMemcpy(const SVF::SVFValue *dst, const SVF::SVFValue *src, SVF
|
|
|
1665
1660
|
}
|
|
1666
1661
|
}
|
|
1667
1662
|
|
|
1668
|
-
const SVFType*
|
|
1663
|
+
const SVFType* AbstractExecution::getPointeeElement(NodeID id)
|
|
1669
1664
|
{
|
|
1670
|
-
assert(
|
|
1671
|
-
if (
|
|
1665
|
+
assert(_svfir2ExeState->inVarToAddrsTable(id) && "id is not in varToAddrsTable");
|
|
1666
|
+
if (_svfir2ExeState->inVarToAddrsTable(id))
|
|
1672
1667
|
{
|
|
1673
|
-
const ExeState::Addrs& addrs =
|
|
1668
|
+
const ExeState::Addrs& addrs = _svfir2ExeState->getAddrs(id);
|
|
1674
1669
|
for (auto addr: addrs)
|
|
1675
1670
|
{
|
|
1676
|
-
NodeID addr_id =
|
|
1671
|
+
NodeID addr_id = _svfir2ExeState->getInternalID(addr);
|
|
1677
1672
|
if (addr_id == 0) // nullptr has no memobj, skip
|
|
1678
1673
|
continue;
|
|
1679
1674
|
return SVFUtil::dyn_cast<ObjVar>(_svfir->getGNode(addr_id))->getMemObj()->getType();
|
|
@@ -1682,9 +1677,9 @@ const SVFType* AEAPI::getPointeeElement(NodeID id)
|
|
|
1682
1677
|
return nullptr;
|
|
1683
1678
|
}
|
|
1684
1679
|
|
|
1685
|
-
void
|
|
1680
|
+
void AbstractExecution::handleMemset(const SVF::SVFValue *dst, SVF::IntervalValue elem, SVF::IntervalValue len)
|
|
1686
1681
|
{
|
|
1687
|
-
IntervalExeState &es =
|
|
1682
|
+
IntervalExeState &es = _svfir2ExeState->getEs();
|
|
1688
1683
|
u32_t dstId = _svfir->getValueNode(dst);
|
|
1689
1684
|
u32_t size = std::min((u32_t)Options::MaxFieldLimit(), (u32_t) len.lb().getNumeral());
|
|
1690
1685
|
u32_t elemSize = 1;
|
|
@@ -1712,9 +1707,9 @@ void AEAPI::handleMemset(const SVF::SVFValue *dst, SVF::IntervalValue elem, SVF:
|
|
|
1712
1707
|
for (u32_t index = 0; index < range_val; index++)
|
|
1713
1708
|
{
|
|
1714
1709
|
// dead loop for string and break if there's a \0. If no \0, it will throw err.
|
|
1715
|
-
if (
|
|
1710
|
+
if (_svfir2ExeState->inVarToAddrsTable(dstId))
|
|
1716
1711
|
{
|
|
1717
|
-
ExeState::Addrs lhs_gep =
|
|
1712
|
+
ExeState::Addrs lhs_gep = _svfir2ExeState->getGepObjAddress(dstId, index);
|
|
1718
1713
|
for (const auto &addr: lhs_gep)
|
|
1719
1714
|
{
|
|
1720
1715
|
u32_t objId = ExeState::getInternalID(addr);
|
|
@@ -1737,7 +1732,7 @@ void AEAPI::handleMemset(const SVF::SVFValue *dst, SVF::IntervalValue elem, SVF:
|
|
|
1737
1732
|
|
|
1738
1733
|
|
|
1739
1734
|
|
|
1740
|
-
void
|
|
1735
|
+
void AbstractExecution::AccessMemoryViaRetNode(const CallICFGNode *callnode, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited)
|
|
1741
1736
|
{
|
|
1742
1737
|
if (callnode->getRetICFGNode()->getSVFStmts().size() > 0)
|
|
1743
1738
|
{
|
|
@@ -1762,7 +1757,7 @@ void AEAPI::AccessMemoryViaRetNode(const CallICFGNode *callnode, SVF::FILOWorkLi
|
|
|
1762
1757
|
}
|
|
1763
1758
|
}
|
|
1764
1759
|
|
|
1765
|
-
void
|
|
1760
|
+
void AbstractExecution::AccessMemoryViaCopyStmt(const CopyStmt *copy, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited)
|
|
1766
1761
|
{
|
|
1767
1762
|
if (!visited.count(copy->getRHSVar()->getValue()))
|
|
1768
1763
|
{
|
|
@@ -1771,14 +1766,14 @@ void AEAPI::AccessMemoryViaCopyStmt(const CopyStmt *copy, SVF::FILOWorkList<cons
|
|
|
1771
1766
|
}
|
|
1772
1767
|
}
|
|
1773
1768
|
|
|
1774
|
-
void
|
|
1769
|
+
void AbstractExecution::AccessMemoryViaLoadStmt(const LoadStmt *load, SVF::FILOWorkList<const SVFValue *>& worklist, Set<const SVFValue *>& visited)
|
|
1775
1770
|
{
|
|
1776
|
-
if (
|
|
1771
|
+
if (_svfir2ExeState->inVarToAddrsTable(load->getLHSVarID()))
|
|
1777
1772
|
{
|
|
1778
|
-
const ExeState::Addrs &Addrs =
|
|
1773
|
+
const ExeState::Addrs &Addrs = _svfir2ExeState->getAddrs(load->getLHSVarID());
|
|
1779
1774
|
for (auto vaddr: Addrs)
|
|
1780
1775
|
{
|
|
1781
|
-
NodeID id =
|
|
1776
|
+
NodeID id = _svfir2ExeState->getInternalID(vaddr);
|
|
1782
1777
|
if (id == 0) // nullptr has no memobj, skip
|
|
1783
1778
|
continue;
|
|
1784
1779
|
const auto *val = _svfir->getGNode(id);
|
|
@@ -1791,11 +1786,11 @@ void AEAPI::AccessMemoryViaLoadStmt(const LoadStmt *load, SVF::FILOWorkList<cons
|
|
|
1791
1786
|
}
|
|
1792
1787
|
}
|
|
1793
1788
|
|
|
1794
|
-
void
|
|
1795
|
-
|
|
1796
|
-
|
|
1789
|
+
void AbstractExecution::AccessMemoryViaCallArgs(const SVF::SVFArgument *arg,
|
|
1790
|
+
SVF::FILOWorkList<const SVFValue *> &worklist,
|
|
1791
|
+
Set<const SVF::SVFValue *> &visited)
|
|
1797
1792
|
{
|
|
1798
|
-
std::vector<const CallICFGNode *> callstack =
|
|
1793
|
+
std::vector<const CallICFGNode *> callstack = _callSiteStack;
|
|
1799
1794
|
SVF::ValVar *arg_gnode = SVFUtil::cast<ValVar>(_svfir->getGNode(_svfir->getValueNode(arg)));
|
|
1800
1795
|
if (arg_gnode->hasIncomingEdges(SVFStmt::PEDGEK::Call))
|
|
1801
1796
|
{
|