Skip to content

Commit 85bd702

Browse files
committed
C++: Exercise the offset column in a test.
1 parent 232b29e commit 85bd702

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎cpp/ql/test/library-tests/dataflow/external-models/flow.expected‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ models
8585
| 84 | Summary: ; ; false; ymlStepGenerated; ; ; Argument[0]; ReturnValue; taint; df-generated |
8686
| 85 | Summary: ; ; false; ymlStepManual; ; ; Argument[0]; ReturnValue; taint; manual |
8787
| 86 | Summary: ; ; false; ymlStepManual_with_body; ; ; Argument[0]; ReturnValue; taint; manual |
88-
| 87 | Summary: ; Container; true; emplace; ; ; Argument[*0]; Argument[forward].Parameter[0]; value; manual |
88+
| 87 | Summary: ; Container; true; emplace; ; ; Argument[*1]; Argument[forward].Parameter[0]; value; manual |
8989
| 88 | Summary: ; Container; true; get; ; ; Argument[-1].Element; ReturnValue[*]; value; manual |
9090
| 89 | Summary: ; Forwarder; true; forward; ; ; Argument[*0]; Argument[forward].Parameter[0]; value; manual |
9191
| 90 | Summary: ; Forwarder; true; get; ; ; Argument[-1]; ReturnValue; value; manual |
@@ -384,9 +384,9 @@ edges
384384
| test.cpp:375:13:375:13 | *c [ul] | test.cpp:375:15:375:16 | ul | provenance | Sink:MaD:3 |
385385
| test.cpp:375:13:375:16 | ul | test.cpp:375:15:375:16 | ul | provenance | Sink:MaD:3 |
386386
| test.cpp:394:11:394:19 | call to ymlSource | test.cpp:394:11:394:19 | call to ymlSource | provenance | Src:MaD:48 |
387-
| test.cpp:394:11:394:19 | call to ymlSource | test.cpp:395:13:395:13 | *x | provenance | |
387+
| test.cpp:394:11:394:19 | call to ymlSource | test.cpp:395:16:395:16 | *x | provenance | |
388388
| test.cpp:395:3:395:3 | emplace output argument [element, x] | test.cpp:397:15:397:15 | *c [element, x] | provenance | |
389-
| test.cpp:395:13:395:13 | *x | test.cpp:395:3:395:3 | emplace output argument [element, x] | provenance | MaD:87 |
389+
| test.cpp:395:16:395:16 | *x | test.cpp:395:3:395:3 | emplace output argument [element, x] | provenance | MaD:87 |
390390
| test.cpp:397:15:397:15 | *c [element, x] | test.cpp:397:20:397:22 | call to get [x] | provenance | MaD:88 |
391391
| test.cpp:397:20:397:22 | call to get [x] | test.cpp:397:20:397:22 | call to get [x] | provenance | |
392392
| test.cpp:397:20:397:22 | call to get [x] | test.cpp:398:11:398:11 | *e [x] | provenance | |
@@ -883,7 +883,7 @@ nodes
883883
| test.cpp:394:11:394:19 | call to ymlSource | semmle.label | call to ymlSource |
884884
| test.cpp:394:11:394:19 | call to ymlSource | semmle.label | call to ymlSource |
885885
| test.cpp:395:3:395:3 | emplace output argument [element, x] | semmle.label | emplace output argument [element, x] |
886-
| test.cpp:395:13:395:13 | *x | semmle.label | *x |
886+
| test.cpp:395:16:395:16 | *x | semmle.label | *x |
887887
| test.cpp:397:15:397:15 | *c [element, x] | semmle.label | *c [element, x] |
888888
| test.cpp:397:20:397:22 | call to get [x] | semmle.label | call to get [x] |
889889
| test.cpp:397:20:397:22 | call to get [x] | semmle.label | call to get [x] |

‎cpp/ql/test/library-tests/dataflow/external-models/flow.ext.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extensions:
4545
- ["", "Forwarder", True, "forward", "", "", "Argument[*0]", "Argument[forward].Parameter[0]", "value", "manual"]
4646
- ["", "Forwarder", True, "forward", "", "", "Argument[forward].Parameter[-1]", "Argument[-1]", "value", "manual"]
4747
- ["", "Forwarder", True, "get", "", "", "Argument[-1]", "ReturnValue", "value", "manual"]
48-
- ["", "Container", True, "emplace", "", "", "Argument[*0]", "Argument[forward].Parameter[0]", "value", "manual"]
48+
- ["", "Container", True, "emplace", "", "", "Argument[*1]", "Argument[forward].Parameter[0]", "value", "manual"]
4949
- ["", "Container", True, "emplace", "", "", "Argument[forward].Parameter[-1]", "Argument[-1].Element", "value", "manual"]
5050
- ["", "Container", True, "get", "", "", "Argument[-1].Element", "ReturnValue[*]", "value", "manual"]
5151
- ["", "Element", True, "Element", "", "", "Argument[0]", "Argument[-1].Field[Element::x]", "value", "manual"]
@@ -54,4 +54,4 @@ extensions:
5454
extensible: forwardsModel
5555
data: # namespace, type, subtypes, name, signature, ext, start, constructor, provenance
5656
- ["", "Forwarder<T>", True, "forward<Args>", "(Args &&)", "", "0", "T", "manual"]
57-
- ["", "Container<T>", True, "emplace<Args>", "(Args &&)", "", "0", "T", "manual"]
57+
- ["", "Container<T>", True, "emplace<Args>", "(int,Args &&)", "", "1", "T", "manual"]

‎cpp/ql/test/library-tests/dataflow/external-models/test.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ void forward_test() {
379379
template<typename T>
380380
struct Container {
381381
template<typename... Args>
382-
void emplace(Args&&... args);
382+
void emplace(int pos, Args&&... args);
383383

384384
T& get();
385385
};
@@ -392,7 +392,7 @@ struct Element {
392392
void forward_test_model() {
393393
Container<Element> c;
394394
int x = ymlSource();
395-
c.emplace(x);
395+
c.emplace(0, x);
396396

397397
Element e = c.get();
398398
ymlSink(e.x); // $ ir

0 commit comments

Comments
 (0)