File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
cpp/ql/test/library-tests/allocators Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -71,3 +71,17 @@ allocationExprs
71
71
| allocators.cpp:142:13:142:27 | new[] | getSizeExpr = x, getSizeMult = 10, requiresDealloc |
72
72
| allocators.cpp:143:13:143:28 | new[] | getSizeBytes = 400, requiresDealloc |
73
73
| allocators.cpp:144:13:144:31 | new[] | getSizeExpr = x, getSizeMult = 900, requiresDealloc |
74
+ deallocationFunctions
75
+ deallocationExprs
76
+ | allocators.cpp:59:3:59:35 | delete | getFreedExpr = 0 |
77
+ | allocators.cpp:60:3:60:38 | delete | getFreedExpr = 0 |
78
+ | allocators.cpp:61:3:61:44 | delete | getFreedExpr = 0 |
79
+ | allocators.cpp:62:3:62:43 | delete | getFreedExpr = 0 |
80
+ | allocators.cpp:63:3:63:47 | delete | getFreedExpr = 0 |
81
+ | allocators.cpp:64:3:64:44 | delete | getFreedExpr = 0 |
82
+ | allocators.cpp:78:3:78:37 | delete[] | getFreedExpr = 0 |
83
+ | allocators.cpp:79:3:79:40 | delete[] | getFreedExpr = 0 |
84
+ | allocators.cpp:80:3:80:46 | delete[] | getFreedExpr = 0 |
85
+ | allocators.cpp:81:3:81:45 | delete[] | getFreedExpr = 0 |
86
+ | allocators.cpp:82:3:82:49 | delete[] | getFreedExpr = 0 |
87
+ | allocators.cpp:83:3:83:23 | delete[] | getFreedExpr = call to GetPointer |
Original file line number Diff line number Diff line change @@ -139,3 +139,19 @@ string describeAllocationExpr(AllocationExpr e) {
139
139
query predicate allocationExprs ( AllocationExpr e , string descr ) {
140
140
descr = concat ( describeAllocationExpr ( e ) , ", " )
141
141
}
142
+
143
+ string describeDeallocationFunction ( DeallocationFunction f ) {
144
+ result = "getFreedArg = " + f .getFreedArg ( ) .toString ( )
145
+ }
146
+
147
+ query predicate deallocationFunctions ( DeallocationFunction f , string descr ) {
148
+ descr = concat ( describeDeallocationFunction ( f ) , ", " )
149
+ }
150
+
151
+ string describeDeallocationExpr ( DeallocationExpr e ) {
152
+ result = "getFreedExpr = " + e .getFreedExpr ( ) .toString ( )
153
+ }
154
+
155
+ query predicate deallocationExprs ( DeallocationExpr e , string descr ) {
156
+ descr = concat ( describeDeallocationExpr ( e ) , ", " )
157
+ }
You can’t perform that action at this time.
0 commit comments