Skip to content

Commit a972d09

Browse files
committed
C++: Accept test changes after changes in IR generation
1 parent 2a64552 commit a972d09

File tree

4 files changed

+78
-44
lines changed

4 files changed

+78
-44
lines changed

cpp/ql/test/experimental/query-tests/Security/CWE/CWE-193/constant-size/ConstantSizeArrayOffByOne.expected

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ edges
3636
| test.cpp:143:18:143:21 | asdf | test.cpp:134:25:134:27 | arr |
3737
| test.cpp:143:18:143:21 | asdf | test.cpp:143:18:143:21 | asdf |
3838
| test.cpp:146:26:146:26 | p indirection | test.cpp:147:4:147:9 | -- ... |
39-
| test.cpp:146:26:146:26 | p indirection | test.cpp:148:6:148:9 | * ... |
40-
| test.cpp:146:26:146:26 | p indirection | test.cpp:149:6:149:9 | * ... |
41-
| test.cpp:146:26:146:26 | p indirection | test.cpp:150:6:150:9 | * ... |
4239
| test.cpp:156:12:156:14 | buf | test.cpp:156:12:156:18 | ... + ... |
4340
| test.cpp:156:12:156:18 | ... + ... | test.cpp:158:17:158:18 | & ... indirection |
4441
| test.cpp:158:17:158:18 | & ... indirection | test.cpp:146:26:146:26 | p indirection |
@@ -126,9 +123,6 @@ nodes
126123
| test.cpp:143:18:143:21 | asdf | semmle.label | asdf |
127124
| test.cpp:146:26:146:26 | p indirection | semmle.label | p indirection |
128125
| test.cpp:147:4:147:9 | -- ... | semmle.label | -- ... |
129-
| test.cpp:148:6:148:9 | * ... | semmle.label | * ... |
130-
| test.cpp:149:6:149:9 | * ... | semmle.label | * ... |
131-
| test.cpp:150:6:150:9 | * ... | semmle.label | * ... |
132126
| test.cpp:156:12:156:14 | buf | semmle.label | buf |
133127
| test.cpp:156:12:156:18 | ... + ... | semmle.label | ... + ... |
134128
| test.cpp:158:17:158:18 | & ... indirection | semmle.label | & ... indirection |
@@ -182,9 +176,6 @@ subpaths
182176
| test.cpp:128:9:128:14 | PointerAdd: access to array | test.cpp:128:9:128:11 | arr | test.cpp:128:9:128:14 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:125:11:125:13 | arr | arr | test.cpp:128:9:128:18 | Store: ... = ... | write |
183177
| test.cpp:136:9:136:16 | PointerAdd: ... += ... | test.cpp:143:18:143:21 | asdf | test.cpp:138:13:138:15 | arr | This pointer arithmetic may have an off-by-2 error allowing it to overrun $@ at this $@. | test.cpp:142:10:142:13 | asdf | asdf | test.cpp:138:12:138:15 | Load: * ... | read |
184178
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:147:4:147:9 | -- ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:147:3:147:13 | Store: ... = ... | write |
185-
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:148:6:148:9 | * ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:147:3:147:13 | Store: ... = ... | write |
186-
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:149:6:149:9 | * ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:148:3:148:13 | Store: ... = ... | write |
187-
| test.cpp:156:12:156:18 | PointerAdd: ... + ... | test.cpp:156:12:156:14 | buf | test.cpp:150:6:150:9 | * ... | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:154:7:154:9 | buf | buf | test.cpp:149:3:149:13 | Store: ... = ... | write |
188179
| test.cpp:221:5:221:11 | PointerAdd: access to array | test.cpp:218:23:218:28 | buffer | test.cpp:221:5:221:11 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:217:19:217:24 | buffer | buffer | test.cpp:221:5:221:15 | Store: ... = ... | write |
189180
| test.cpp:232:5:232:10 | PointerAdd: access to array | test.cpp:229:25:229:29 | array | test.cpp:232:5:232:10 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:228:10:228:14 | array | array | test.cpp:232:5:232:19 | Store: ... = ... | write |
190181
| test.cpp:261:27:261:30 | PointerAdd: access to array | test.cpp:286:19:286:25 | buffer2 | test.cpp:261:27:261:30 | access to array | This pointer arithmetic may have an off-by-1 error allowing it to overrun $@ at this $@. | test.cpp:285:19:285:25 | buffer2 | buffer2 | test.cpp:261:27:261:30 | Load: access to array | read |

cpp/ql/test/library-tests/dataflow/taint-tests/map.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ void test_map()
165165
// array-like access
166166
std::map<char *, char *> m10, m11, m12, m13;
167167
sink(m10["abc"] = "def");
168-
sink(m11["abc"] = source()); // $ ast ir=168:7 ir=168:20
168+
sink(m11["abc"] = source()); // $ ast,ir
169169
sink(m12.at("abc") = "def");
170-
sink(m13.at("abc") = source()); // $ ast ir=170:7 ir=170:23
170+
sink(m13.at("abc") = source()); // $ ast,ir
171171
sink(m10["abc"]);
172172
sink(m11["abc"]); // $ ast,ir
173173
sink(m12["abc"]);
@@ -317,9 +317,9 @@ void test_unordered_map()
317317
// array-like access
318318
std::unordered_map<char *, char *> m10, m11, m12, m13;
319319
sink(m10["abc"] = "def");
320-
sink(m11["abc"] = source()); // $ ast ir=320:7 ir=320:20
320+
sink(m11["abc"] = source()); // $ ast,ir
321321
sink(m12.at("abc") = "def");
322-
sink(m13.at("abc") = source()); // $ ast ir=322:7 ir=322:23
322+
sink(m13.at("abc") = source()); // $ ast,ir
323323
sink(m10["abc"]);
324324
sink(m11["abc"]); // $ ast,ir
325325
sink(m12["abc"]);

cpp/ql/test/library-tests/dataflow/taint-tests/taint.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ void arithAssignments(int source1, int clean1) {
1313
source1++;
1414
++source1;
1515
source1 += 1;
16-
sink(source1); // $ ast ir=12:13 ir=12:22
17-
sink(++source1); // $ ast ir=12:13 ir=12:22
16+
sink(source1); // $ ast,ir
17+
sink(++source1); // $ ast,ir
1818
}
1919

2020
// --- globals ---

0 commit comments

Comments
 (0)