From 8f6f7880b3fd38f525260e6fc4e6ba185d256417 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 12 Oct 2026 13:29:19 +0100 Subject: [PATCH 1/3] C++: Test nested typedefs in forwarding. --- .../dataflow/external-models/flow.ext.yml | 2 +- .../dataflow/external-models/test.cpp | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/cpp/ql/test/library-tests/dataflow/external-models/flow.ext.yml b/cpp/ql/test/library-tests/dataflow/external-models/flow.ext.yml index 105d0a050311..77f168112bb5 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/flow.ext.yml +++ b/cpp/ql/test/library-tests/dataflow/external-models/flow.ext.yml @@ -53,4 +53,4 @@ extensions: - ["", "Forwarder", True, "forward", "(Args &&)", "", "0", "T", "Argument[-1]", "manual"] - ["", "", False, "makeForwarded", "(int)", "", "0", "T", "ReturnValue", "manual"] - ["", "Forwarder", True, "forwardToElement", "(int)", "", "0", "Element", "Argument[-1]", "manual"] - - ["", "Container", True, "emplace", "(int,Args &&)", "", "1", "T", "Argument[-1].Element", "manual"] + - ["", "Container", True, "emplace", "(int,Args &&)", "", "1", "value_type", "Argument[-1].Element", "manual"] diff --git a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp index bfc7c9ed1148..fb0f49eae9c4 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp @@ -379,6 +379,7 @@ void forward_test() { template struct Container { + using value_type = T; template void emplace(int pos, Args&&... args); @@ -413,7 +414,17 @@ void forward_test_model() { c.emplace(0, x); Element e = c.get(); - ymlSink(e.x); // $ ir + ymlSink(e.x); // $ MISSING: ir +} + +void forward_test_member_alias_scalar() { + Container scalar; + scalar.emplace(0, ymlSource()); + ymlSink(scalar.get()); // $ MISSING: ir + + Container pointer; + pointer.emplace(0, ymlSourcePtr()); + ymlSink(*pointer.get()); // $ MISSING: ir } struct ElementWithDefaultArgument { @@ -427,7 +438,7 @@ void forward_test_model_with_default_argument() { c.emplace(0, x); ElementWithDefaultArgument e = c.get(); - ymlSink(e.x); // $ ir + ymlSink(e.x); // $ MISSING: ir } struct ElementWithOverloadedArity { @@ -441,7 +452,7 @@ void forward_test_constructor_arity() { { Container c; c.emplace(0, x); - ymlSink(c.get().x); // $ ir + ymlSink(c.get().x); // $ MISSING: ir } { Container c; @@ -451,7 +462,7 @@ void forward_test_constructor_arity() { { Container c; c.emplace(0, 0, x); - ymlSink(c.get().x); // $ ir + ymlSink(c.get().x); // $ MISSING: ir } } From 40180246ccca94ecdf156b2bcb3ced18b3be6944 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Thu, 22 Oct 2026 13:23:57 +0200 Subject: [PATCH 2/3] C++: Support typedef's in forward models. This commit should be read with `?w=1`. --- .../semmle/code/cpp/dataflow/ExternalFlow.qll | 17 +++++++++++------ .../dataflow/external-models/test.cpp | 12 ++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll index 80f296dca483..ee894f95648f 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll @@ -1088,21 +1088,26 @@ private Type getForwardedConstructorType( Function forwarder, string namespace, string type, boolean subtypes, string name, string signature, string ext, string constructorType ) { - exists(int index | - forwardsModel(namespace, type, subtypes, name, signature, ext, _, constructorType, _, _, _) and - forwarder = interpretElement(namespace, type, subtypes, name, signature, ext) - | - exists(string typeArguments | + forwardsModel(namespace, type, subtypes, name, signature, ext, _, constructorType, _, _, _) and + forwarder = interpretElement(namespace, type, subtypes, name, signature, ext) and + ( + exists(string typeArguments, int index | parseAngles(type, _, typeArguments, "") and constructorType = getAtIndex(typeArguments, index) and result = forwarder.getDeclaringType().getTemplateArgument(index) ) or - exists(string nameArguments | + exists(string nameArguments, int index | parseAngles(name, _, nameArguments, "") and constructorType = getAtIndex(nameArguments, index) and result = forwarder.getTemplateArgument(index) ) + or + exists(TypedefType member | + member = forwarder.getDeclaringType().getAMember() and + member.hasName(constructorType) and + result = member.getUnderlyingType() + ) ) } diff --git a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp index fb0f49eae9c4..b0e5016e4697 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/test.cpp +++ b/cpp/ql/test/library-tests/dataflow/external-models/test.cpp @@ -414,17 +414,17 @@ void forward_test_model() { c.emplace(0, x); Element e = c.get(); - ymlSink(e.x); // $ MISSING: ir + ymlSink(e.x); // $ ir } void forward_test_member_alias_scalar() { Container scalar; scalar.emplace(0, ymlSource()); - ymlSink(scalar.get()); // $ MISSING: ir + ymlSink(scalar.get()); // $ ir Container pointer; pointer.emplace(0, ymlSourcePtr()); - ymlSink(*pointer.get()); // $ MISSING: ir + ymlSink(*pointer.get()); // $ ir } struct ElementWithDefaultArgument { @@ -438,7 +438,7 @@ void forward_test_model_with_default_argument() { c.emplace(0, x); ElementWithDefaultArgument e = c.get(); - ymlSink(e.x); // $ MISSING: ir + ymlSink(e.x); // $ ir } struct ElementWithOverloadedArity { @@ -452,7 +452,7 @@ void forward_test_constructor_arity() { { Container c; c.emplace(0, x); - ymlSink(c.get().x); // $ MISSING: ir + ymlSink(c.get().x); // $ ir } { Container c; @@ -462,7 +462,7 @@ void forward_test_constructor_arity() { { Container c; c.emplace(0, 0, x); - ymlSink(c.get().x); // $ MISSING: ir + ymlSink(c.get().x); // $ ir } } From da6b7661c0cdf3dd9491357809581f9e57b359d5 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Wed, 4 Nov 2026 15:01:42 +0100 Subject: [PATCH 3/3] C++: Accept test changes. --- .../dataflow/external-models/flow.expected | 306 ++++++++++-------- .../dataflow/external-models/sinks.expected | 20 +- .../dataflow/external-models/sources.expected | 13 +- 3 files changed, 183 insertions(+), 156 deletions(-) diff --git a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected index aa75f230a746..e4d8ca07ccf0 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/flow.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/flow.expected @@ -1391,72 +1391,83 @@ edges | test.cpp:376:13:376:13 | *c [ul] | test.cpp:376:13:376:16 | ul | provenance | | | test.cpp:376:13:376:13 | *c [ul] | test.cpp:376:15:376:16 | ul | provenance | Sink:MaD:3 | | test.cpp:376:13:376:16 | ul | test.cpp:376:15:376:16 | ul | provenance | Sink:MaD:3 | -| test.cpp:397:11:397:19 | call to ymlSource | test.cpp:397:11:397:19 | call to ymlSource | provenance | Src:MaD:48 | -| test.cpp:397:11:397:19 | call to ymlSource | test.cpp:398:38:398:38 | x | provenance | | -| test.cpp:398:15:398:36 | call to makeForwarded [x] | test.cpp:398:15:398:36 | call to makeForwarded [x] | provenance | | -| test.cpp:398:15:398:36 | call to makeForwarded [x] | test.cpp:399:11:399:11 | *e [x] | provenance | | -| test.cpp:398:38:398:38 | x | test.cpp:398:15:398:36 | call to makeForwarded [x] | provenance | | -| test.cpp:399:11:399:11 | *e [x] | test.cpp:399:13:399:13 | x | provenance | | -| test.cpp:399:13:399:13 | x | test.cpp:399:13:399:13 | x | provenance | Sink:MaD:3 | -| test.cpp:404:11:404:19 | call to ymlSource | test.cpp:404:11:404:19 | call to ymlSource | provenance | Src:MaD:48 | -| test.cpp:404:11:404:19 | call to ymlSource | test.cpp:405:22:405:22 | x | provenance | | -| test.cpp:405:3:405:3 | forwardToElement output argument [x] | test.cpp:406:15:406:15 | *f [x] | provenance | | -| test.cpp:405:22:405:22 | x | test.cpp:405:3:405:3 | forwardToElement output argument [x] | provenance | | -| test.cpp:406:15:406:15 | *f [x] | test.cpp:406:17:406:19 | call to get [x] | provenance | MaD:88 | -| test.cpp:406:17:406:19 | call to get [x] | test.cpp:406:17:406:19 | call to get [x] | provenance | | -| test.cpp:406:17:406:19 | call to get [x] | test.cpp:407:11:407:11 | *e [x] | provenance | | -| test.cpp:407:11:407:11 | *e [x] | test.cpp:407:13:407:13 | x | provenance | | -| test.cpp:407:13:407:13 | x | test.cpp:407:13:407:13 | x | provenance | Sink:MaD:3 | -| test.cpp:412:11:412:19 | call to ymlSource | test.cpp:412:11:412:19 | call to ymlSource | provenance | Src:MaD:48 | -| test.cpp:412:11:412:19 | call to ymlSource | test.cpp:413:16:413:16 | *x | provenance | | -| test.cpp:413:3:413:3 | emplace output argument [element, x] | test.cpp:415:15:415:15 | *c [element, x] | provenance | | -| test.cpp:413:16:413:16 | *x | test.cpp:413:3:413:3 | emplace output argument [element, x] | provenance | | -| test.cpp:415:15:415:15 | *c [element, x] | test.cpp:415:20:415:22 | call to get [x] | provenance | MaD:87 | -| test.cpp:415:20:415:22 | call to get [x] | test.cpp:415:20:415:22 | call to get [x] | provenance | | -| test.cpp:415:20:415:22 | call to get [x] | test.cpp:416:11:416:11 | *e [x] | provenance | | -| test.cpp:416:11:416:11 | *e [x] | test.cpp:416:13:416:13 | x | provenance | | -| test.cpp:416:13:416:13 | x | test.cpp:416:13:416:13 | x | provenance | Sink:MaD:3 | -| test.cpp:426:11:426:19 | call to ymlSource | test.cpp:426:11:426:19 | call to ymlSource | provenance | Src:MaD:48 | -| test.cpp:426:11:426:19 | call to ymlSource | test.cpp:427:16:427:16 | *x | provenance | | -| test.cpp:427:3:427:3 | emplace output argument [element, x] | test.cpp:429:34:429:34 | *c [element, x] | provenance | | -| test.cpp:427:16:427:16 | *x | test.cpp:427:3:427:3 | emplace output argument [element, x] | provenance | | -| test.cpp:429:34:429:34 | *c [element, x] | test.cpp:429:39:429:41 | call to get [x] | provenance | MaD:87 | -| test.cpp:429:39:429:41 | call to get [x] | test.cpp:429:39:429:41 | call to get [x] | provenance | | -| test.cpp:429:39:429:41 | call to get [x] | test.cpp:430:11:430:11 | *e [x] | provenance | | -| test.cpp:430:11:430:11 | *e [x] | test.cpp:430:13:430:13 | x | provenance | | -| test.cpp:430:13:430:13 | x | test.cpp:430:13:430:13 | x | provenance | Sink:MaD:3 | -| test.cpp:435:3:435:28 | *ElementWithOverloadedArity [post update] [x] | test.cpp:435:3:435:28 | *this [Return] [x] | provenance | | -| test.cpp:435:34:435:38 | first | test.cpp:435:45:435:49 | first | provenance | | -| test.cpp:435:45:435:49 | first | test.cpp:435:3:435:28 | *ElementWithOverloadedArity [post update] [x] | provenance | | -| test.cpp:436:3:436:28 | *ElementWithOverloadedArity [post update] [x] | test.cpp:436:3:436:28 | *this [Return] [x] | provenance | | -| test.cpp:436:39:436:44 | second | test.cpp:436:51:436:56 | second | provenance | | -| test.cpp:436:51:436:56 | second | test.cpp:436:3:436:28 | *ElementWithOverloadedArity [post update] [x] | provenance | | -| test.cpp:440:11:440:19 | call to ymlSource | test.cpp:440:11:440:19 | call to ymlSource | provenance | Src:MaD:48 | -| test.cpp:440:11:440:19 | call to ymlSource | test.cpp:443:18:443:18 | *x | provenance | | -| test.cpp:440:11:440:19 | call to ymlSource | test.cpp:453:21:453:21 | *x | provenance | | -| test.cpp:443:5:443:5 | emplace output argument [element, x] | test.cpp:444:13:444:13 | *c [element, x] | provenance | | -| test.cpp:443:18:443:18 | *x | test.cpp:435:34:435:38 | first | provenance | | -| test.cpp:443:18:443:18 | *x | test.cpp:443:5:443:5 | emplace output argument [element, x] | provenance | | -| test.cpp:444:13:444:13 | *c [element, x] | test.cpp:444:18:444:20 | *call to get [x] | provenance | MaD:87 | -| test.cpp:444:18:444:20 | *call to get [x] | test.cpp:444:21:444:21 | x | provenance | | -| test.cpp:444:21:444:21 | x | test.cpp:444:21:444:21 | x | provenance | Sink:MaD:3 | -| test.cpp:453:5:453:5 | emplace output argument [element, x] | test.cpp:454:13:454:13 | *c [element, x] | provenance | | -| test.cpp:453:21:453:21 | *x | test.cpp:436:39:436:44 | second | provenance | | -| test.cpp:453:21:453:21 | *x | test.cpp:453:5:453:5 | emplace output argument [element, x] | provenance | | -| test.cpp:454:13:454:13 | *c [element, x] | test.cpp:454:18:454:20 | *call to get [x] | provenance | MaD:87 | -| test.cpp:454:18:454:20 | *call to get [x] | test.cpp:454:21:454:21 | x | provenance | | -| test.cpp:454:21:454:21 | x | test.cpp:454:21:454:21 | x | provenance | Sink:MaD:3 | -| test.cpp:461:5:461:5 | forward output argument | test.cpp:462:13:462:13 | *f | provenance | | -| test.cpp:461:15:461:23 | call to ymlSource | test.cpp:461:15:461:23 | call to ymlSource | provenance | Src:MaD:48 | -| test.cpp:461:15:461:23 | call to ymlSource | test.cpp:461:15:461:25 | call to ymlSource | provenance | | -| test.cpp:461:15:461:25 | call to ymlSource | test.cpp:461:5:461:5 | forward output argument | provenance | | -| test.cpp:462:13:462:13 | *f | test.cpp:462:15:462:17 | call to get | provenance | MaD:88 | -| test.cpp:462:15:462:17 | call to get | test.cpp:462:15:462:17 | call to get | provenance | Sink:MaD:3 | -| test.cpp:466:5:466:5 | forward output argument | test.cpp:467:14:467:14 | *f | provenance | | -| test.cpp:466:15:466:26 | *call to ymlSourcePtr | test.cpp:466:15:466:28 | **call to ymlSourcePtr | provenance | | -| test.cpp:466:15:466:26 | call to ymlSourcePtr | test.cpp:466:15:466:26 | *call to ymlSourcePtr | provenance | Src:MaD:49 | -| test.cpp:466:15:466:28 | **call to ymlSourcePtr | test.cpp:466:5:466:5 | forward output argument | provenance | | -| test.cpp:467:14:467:14 | *f | test.cpp:467:13:467:20 | * ... | provenance | MaD:88 Sink:MaD:3 | +| test.cpp:398:11:398:19 | call to ymlSource | test.cpp:398:11:398:19 | call to ymlSource | provenance | Src:MaD:48 | +| test.cpp:398:11:398:19 | call to ymlSource | test.cpp:399:38:399:38 | x | provenance | | +| test.cpp:399:15:399:36 | call to makeForwarded [x] | test.cpp:399:15:399:36 | call to makeForwarded [x] | provenance | | +| test.cpp:399:15:399:36 | call to makeForwarded [x] | test.cpp:400:11:400:11 | *e [x] | provenance | | +| test.cpp:399:38:399:38 | x | test.cpp:399:15:399:36 | call to makeForwarded [x] | provenance | | +| test.cpp:400:11:400:11 | *e [x] | test.cpp:400:13:400:13 | x | provenance | | +| test.cpp:400:13:400:13 | x | test.cpp:400:13:400:13 | x | provenance | Sink:MaD:3 | +| test.cpp:405:11:405:19 | call to ymlSource | test.cpp:405:11:405:19 | call to ymlSource | provenance | Src:MaD:48 | +| test.cpp:405:11:405:19 | call to ymlSource | test.cpp:406:22:406:22 | x | provenance | | +| test.cpp:406:3:406:3 | forwardToElement output argument [x] | test.cpp:407:15:407:15 | *f [x] | provenance | | +| test.cpp:406:22:406:22 | x | test.cpp:406:3:406:3 | forwardToElement output argument [x] | provenance | | +| test.cpp:407:15:407:15 | *f [x] | test.cpp:407:17:407:19 | call to get [x] | provenance | MaD:88 | +| test.cpp:407:17:407:19 | call to get [x] | test.cpp:407:17:407:19 | call to get [x] | provenance | | +| test.cpp:407:17:407:19 | call to get [x] | test.cpp:408:11:408:11 | *e [x] | provenance | | +| test.cpp:408:11:408:11 | *e [x] | test.cpp:408:13:408:13 | x | provenance | | +| test.cpp:408:13:408:13 | x | test.cpp:408:13:408:13 | x | provenance | Sink:MaD:3 | +| test.cpp:413:11:413:19 | call to ymlSource | test.cpp:413:11:413:19 | call to ymlSource | provenance | Src:MaD:48 | +| test.cpp:413:11:413:19 | call to ymlSource | test.cpp:414:16:414:16 | *x | provenance | | +| test.cpp:414:3:414:3 | emplace output argument [element, x] | test.cpp:416:15:416:15 | *c [element, x] | provenance | | +| test.cpp:414:16:414:16 | *x | test.cpp:414:3:414:3 | emplace output argument [element, x] | provenance | | +| test.cpp:416:15:416:15 | *c [element, x] | test.cpp:416:20:416:22 | call to get [x] | provenance | MaD:87 | +| test.cpp:416:20:416:22 | call to get [x] | test.cpp:416:20:416:22 | call to get [x] | provenance | | +| test.cpp:416:20:416:22 | call to get [x] | test.cpp:417:11:417:11 | *e [x] | provenance | | +| test.cpp:417:11:417:11 | *e [x] | test.cpp:417:13:417:13 | x | provenance | | +| test.cpp:417:13:417:13 | x | test.cpp:417:13:417:13 | x | provenance | Sink:MaD:3 | +| test.cpp:422:3:422:8 | emplace output argument [element] | test.cpp:423:11:423:16 | *scalar [element] | provenance | | +| test.cpp:422:21:422:29 | call to ymlSource | test.cpp:422:21:422:29 | call to ymlSource | provenance | Src:MaD:48 | +| test.cpp:422:21:422:29 | call to ymlSource | test.cpp:422:21:422:31 | call to ymlSource | provenance | | +| test.cpp:422:21:422:31 | call to ymlSource | test.cpp:422:3:422:8 | emplace output argument [element] | provenance | | +| test.cpp:423:11:423:16 | *scalar [element] | test.cpp:423:21:423:23 | call to get | provenance | MaD:87 | +| test.cpp:423:21:423:23 | call to get | test.cpp:423:18:423:20 | call to get | provenance | Sink:MaD:3 | +| test.cpp:426:3:426:9 | emplace output argument [element] | test.cpp:427:12:427:18 | *pointer [element] | provenance | | +| test.cpp:426:22:426:33 | *call to ymlSourcePtr | test.cpp:426:22:426:35 | **call to ymlSourcePtr | provenance | | +| test.cpp:426:22:426:33 | call to ymlSourcePtr | test.cpp:426:22:426:33 | *call to ymlSourcePtr | provenance | Src:MaD:49 | +| test.cpp:426:22:426:35 | **call to ymlSourcePtr | test.cpp:426:3:426:9 | emplace output argument [element] | provenance | | +| test.cpp:427:12:427:18 | *pointer [element] | test.cpp:427:11:427:24 | * ... | provenance | MaD:87 Sink:MaD:3 | +| test.cpp:437:11:437:19 | call to ymlSource | test.cpp:437:11:437:19 | call to ymlSource | provenance | Src:MaD:48 | +| test.cpp:437:11:437:19 | call to ymlSource | test.cpp:438:16:438:16 | *x | provenance | | +| test.cpp:438:3:438:3 | emplace output argument [element, x] | test.cpp:440:34:440:34 | *c [element, x] | provenance | | +| test.cpp:438:16:438:16 | *x | test.cpp:438:3:438:3 | emplace output argument [element, x] | provenance | | +| test.cpp:440:34:440:34 | *c [element, x] | test.cpp:440:39:440:41 | call to get [x] | provenance | MaD:87 | +| test.cpp:440:39:440:41 | call to get [x] | test.cpp:440:39:440:41 | call to get [x] | provenance | | +| test.cpp:440:39:440:41 | call to get [x] | test.cpp:441:11:441:11 | *e [x] | provenance | | +| test.cpp:441:11:441:11 | *e [x] | test.cpp:441:13:441:13 | x | provenance | | +| test.cpp:441:13:441:13 | x | test.cpp:441:13:441:13 | x | provenance | Sink:MaD:3 | +| test.cpp:446:3:446:28 | *ElementWithOverloadedArity [post update] [x] | test.cpp:446:3:446:28 | *this [Return] [x] | provenance | | +| test.cpp:446:34:446:38 | first | test.cpp:446:45:446:49 | first | provenance | | +| test.cpp:446:45:446:49 | first | test.cpp:446:3:446:28 | *ElementWithOverloadedArity [post update] [x] | provenance | | +| test.cpp:447:3:447:28 | *ElementWithOverloadedArity [post update] [x] | test.cpp:447:3:447:28 | *this [Return] [x] | provenance | | +| test.cpp:447:39:447:44 | second | test.cpp:447:51:447:56 | second | provenance | | +| test.cpp:447:51:447:56 | second | test.cpp:447:3:447:28 | *ElementWithOverloadedArity [post update] [x] | provenance | | +| test.cpp:451:11:451:19 | call to ymlSource | test.cpp:451:11:451:19 | call to ymlSource | provenance | Src:MaD:48 | +| test.cpp:451:11:451:19 | call to ymlSource | test.cpp:454:18:454:18 | *x | provenance | | +| test.cpp:451:11:451:19 | call to ymlSource | test.cpp:464:21:464:21 | *x | provenance | | +| test.cpp:454:5:454:5 | emplace output argument [element, x] | test.cpp:455:13:455:13 | *c [element, x] | provenance | | +| test.cpp:454:18:454:18 | *x | test.cpp:446:34:446:38 | first | provenance | | +| test.cpp:454:18:454:18 | *x | test.cpp:454:5:454:5 | emplace output argument [element, x] | provenance | | +| test.cpp:455:13:455:13 | *c [element, x] | test.cpp:455:18:455:20 | *call to get [x] | provenance | MaD:87 | +| test.cpp:455:18:455:20 | *call to get [x] | test.cpp:455:21:455:21 | x | provenance | | +| test.cpp:455:21:455:21 | x | test.cpp:455:21:455:21 | x | provenance | Sink:MaD:3 | +| test.cpp:464:5:464:5 | emplace output argument [element, x] | test.cpp:465:13:465:13 | *c [element, x] | provenance | | +| test.cpp:464:21:464:21 | *x | test.cpp:447:39:447:44 | second | provenance | | +| test.cpp:464:21:464:21 | *x | test.cpp:464:5:464:5 | emplace output argument [element, x] | provenance | | +| test.cpp:465:13:465:13 | *c [element, x] | test.cpp:465:18:465:20 | *call to get [x] | provenance | MaD:87 | +| test.cpp:465:18:465:20 | *call to get [x] | test.cpp:465:21:465:21 | x | provenance | | +| test.cpp:465:21:465:21 | x | test.cpp:465:21:465:21 | x | provenance | Sink:MaD:3 | +| test.cpp:472:5:472:5 | forward output argument | test.cpp:473:13:473:13 | *f | provenance | | +| test.cpp:472:15:472:23 | call to ymlSource | test.cpp:472:15:472:23 | call to ymlSource | provenance | Src:MaD:48 | +| test.cpp:472:15:472:23 | call to ymlSource | test.cpp:472:15:472:25 | call to ymlSource | provenance | | +| test.cpp:472:15:472:25 | call to ymlSource | test.cpp:472:5:472:5 | forward output argument | provenance | | +| test.cpp:473:13:473:13 | *f | test.cpp:473:15:473:17 | call to get | provenance | MaD:88 | +| test.cpp:473:15:473:17 | call to get | test.cpp:473:15:473:17 | call to get | provenance | Sink:MaD:3 | +| test.cpp:477:5:477:5 | forward output argument | test.cpp:478:14:478:14 | *f | provenance | | +| test.cpp:477:15:477:26 | *call to ymlSourcePtr | test.cpp:477:15:477:28 | **call to ymlSourcePtr | provenance | | +| test.cpp:477:15:477:26 | call to ymlSourcePtr | test.cpp:477:15:477:26 | *call to ymlSourcePtr | provenance | Src:MaD:49 | +| test.cpp:477:15:477:28 | **call to ymlSourcePtr | test.cpp:477:5:477:5 | forward output argument | provenance | | +| test.cpp:478:14:478:14 | *f | test.cpp:478:13:478:20 | * ... | provenance | MaD:88 Sink:MaD:3 | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:24:8:24:11 | * ... | provenance | | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:27:36:27:38 | *cmd | provenance | | | windows.cpp:22:15:22:29 | call to GetCommandLineA | windows.cpp:22:15:22:29 | *call to GetCommandLineA | provenance | Src:MaD:5 | @@ -2858,79 +2869,92 @@ nodes | test.cpp:376:13:376:13 | *c [ul] | semmle.label | *c [ul] | | test.cpp:376:13:376:16 | ul | semmle.label | ul | | test.cpp:376:15:376:16 | ul | semmle.label | ul | -| test.cpp:397:11:397:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:397:11:397:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:398:15:398:36 | call to makeForwarded [x] | semmle.label | call to makeForwarded [x] | -| test.cpp:398:15:398:36 | call to makeForwarded [x] | semmle.label | call to makeForwarded [x] | -| test.cpp:398:38:398:38 | x | semmle.label | x | -| test.cpp:399:11:399:11 | *e [x] | semmle.label | *e [x] | -| test.cpp:399:13:399:13 | x | semmle.label | x | -| test.cpp:399:13:399:13 | x | semmle.label | x | -| test.cpp:404:11:404:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:404:11:404:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:405:3:405:3 | forwardToElement output argument [x] | semmle.label | forwardToElement output argument [x] | -| test.cpp:405:22:405:22 | x | semmle.label | x | -| test.cpp:406:15:406:15 | *f [x] | semmle.label | *f [x] | -| test.cpp:406:17:406:19 | call to get [x] | semmle.label | call to get [x] | -| test.cpp:406:17:406:19 | call to get [x] | semmle.label | call to get [x] | -| test.cpp:407:11:407:11 | *e [x] | semmle.label | *e [x] | -| test.cpp:407:13:407:13 | x | semmle.label | x | -| test.cpp:407:13:407:13 | x | semmle.label | x | -| test.cpp:412:11:412:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:412:11:412:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:413:3:413:3 | emplace output argument [element, x] | semmle.label | emplace output argument [element, x] | -| test.cpp:413:16:413:16 | *x | semmle.label | *x | -| test.cpp:415:15:415:15 | *c [element, x] | semmle.label | *c [element, x] | -| test.cpp:415:20:415:22 | call to get [x] | semmle.label | call to get [x] | -| test.cpp:415:20:415:22 | call to get [x] | semmle.label | call to get [x] | -| test.cpp:416:11:416:11 | *e [x] | semmle.label | *e [x] | -| test.cpp:416:13:416:13 | x | semmle.label | x | -| test.cpp:416:13:416:13 | x | semmle.label | x | -| test.cpp:426:11:426:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:426:11:426:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:427:3:427:3 | emplace output argument [element, x] | semmle.label | emplace output argument [element, x] | -| test.cpp:427:16:427:16 | *x | semmle.label | *x | -| test.cpp:429:34:429:34 | *c [element, x] | semmle.label | *c [element, x] | -| test.cpp:429:39:429:41 | call to get [x] | semmle.label | call to get [x] | -| test.cpp:429:39:429:41 | call to get [x] | semmle.label | call to get [x] | -| test.cpp:430:11:430:11 | *e [x] | semmle.label | *e [x] | -| test.cpp:430:13:430:13 | x | semmle.label | x | -| test.cpp:430:13:430:13 | x | semmle.label | x | -| test.cpp:435:3:435:28 | *ElementWithOverloadedArity [post update] [x] | semmle.label | *ElementWithOverloadedArity [post update] [x] | -| test.cpp:435:3:435:28 | *this [Return] [x] | semmle.label | *this [Return] [x] | -| test.cpp:435:34:435:38 | first | semmle.label | first | -| test.cpp:435:45:435:49 | first | semmle.label | first | -| test.cpp:436:3:436:28 | *ElementWithOverloadedArity [post update] [x] | semmle.label | *ElementWithOverloadedArity [post update] [x] | -| test.cpp:436:3:436:28 | *this [Return] [x] | semmle.label | *this [Return] [x] | -| test.cpp:436:39:436:44 | second | semmle.label | second | -| test.cpp:436:51:436:56 | second | semmle.label | second | -| test.cpp:440:11:440:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:440:11:440:19 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:443:5:443:5 | emplace output argument [element, x] | semmle.label | emplace output argument [element, x] | -| test.cpp:443:18:443:18 | *x | semmle.label | *x | -| test.cpp:444:13:444:13 | *c [element, x] | semmle.label | *c [element, x] | -| test.cpp:444:18:444:20 | *call to get [x] | semmle.label | *call to get [x] | -| test.cpp:444:21:444:21 | x | semmle.label | x | -| test.cpp:444:21:444:21 | x | semmle.label | x | -| test.cpp:453:5:453:5 | emplace output argument [element, x] | semmle.label | emplace output argument [element, x] | -| test.cpp:453:21:453:21 | *x | semmle.label | *x | -| test.cpp:454:13:454:13 | *c [element, x] | semmle.label | *c [element, x] | -| test.cpp:454:18:454:20 | *call to get [x] | semmle.label | *call to get [x] | -| test.cpp:454:21:454:21 | x | semmle.label | x | -| test.cpp:454:21:454:21 | x | semmle.label | x | -| test.cpp:461:5:461:5 | forward output argument | semmle.label | forward output argument | -| test.cpp:461:15:461:23 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:461:15:461:23 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:461:15:461:25 | call to ymlSource | semmle.label | call to ymlSource | -| test.cpp:462:13:462:13 | *f | semmle.label | *f | -| test.cpp:462:15:462:17 | call to get | semmle.label | call to get | -| test.cpp:462:15:462:17 | call to get | semmle.label | call to get | -| test.cpp:466:5:466:5 | forward output argument | semmle.label | forward output argument | -| test.cpp:466:15:466:26 | *call to ymlSourcePtr | semmle.label | *call to ymlSourcePtr | -| test.cpp:466:15:466:26 | call to ymlSourcePtr | semmle.label | call to ymlSourcePtr | -| test.cpp:466:15:466:28 | **call to ymlSourcePtr | semmle.label | **call to ymlSourcePtr | -| test.cpp:467:13:467:20 | * ... | semmle.label | * ... | -| test.cpp:467:14:467:14 | *f | semmle.label | *f | +| test.cpp:398:11:398:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:398:11:398:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:399:15:399:36 | call to makeForwarded [x] | semmle.label | call to makeForwarded [x] | +| test.cpp:399:15:399:36 | call to makeForwarded [x] | semmle.label | call to makeForwarded [x] | +| test.cpp:399:38:399:38 | x | semmle.label | x | +| test.cpp:400:11:400:11 | *e [x] | semmle.label | *e [x] | +| test.cpp:400:13:400:13 | x | semmle.label | x | +| test.cpp:400:13:400:13 | x | semmle.label | x | +| test.cpp:405:11:405:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:405:11:405:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:406:3:406:3 | forwardToElement output argument [x] | semmle.label | forwardToElement output argument [x] | +| test.cpp:406:22:406:22 | x | semmle.label | x | +| test.cpp:407:15:407:15 | *f [x] | semmle.label | *f [x] | +| test.cpp:407:17:407:19 | call to get [x] | semmle.label | call to get [x] | +| test.cpp:407:17:407:19 | call to get [x] | semmle.label | call to get [x] | +| test.cpp:408:11:408:11 | *e [x] | semmle.label | *e [x] | +| test.cpp:408:13:408:13 | x | semmle.label | x | +| test.cpp:408:13:408:13 | x | semmle.label | x | +| test.cpp:413:11:413:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:413:11:413:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:414:3:414:3 | emplace output argument [element, x] | semmle.label | emplace output argument [element, x] | +| test.cpp:414:16:414:16 | *x | semmle.label | *x | +| test.cpp:416:15:416:15 | *c [element, x] | semmle.label | *c [element, x] | +| test.cpp:416:20:416:22 | call to get [x] | semmle.label | call to get [x] | +| test.cpp:416:20:416:22 | call to get [x] | semmle.label | call to get [x] | +| test.cpp:417:11:417:11 | *e [x] | semmle.label | *e [x] | +| test.cpp:417:13:417:13 | x | semmle.label | x | +| test.cpp:417:13:417:13 | x | semmle.label | x | +| test.cpp:422:3:422:8 | emplace output argument [element] | semmle.label | emplace output argument [element] | +| test.cpp:422:21:422:29 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:422:21:422:29 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:422:21:422:31 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:423:11:423:16 | *scalar [element] | semmle.label | *scalar [element] | +| test.cpp:423:18:423:20 | call to get | semmle.label | call to get | +| test.cpp:423:21:423:23 | call to get | semmle.label | call to get | +| test.cpp:426:3:426:9 | emplace output argument [element] | semmle.label | emplace output argument [element] | +| test.cpp:426:22:426:33 | *call to ymlSourcePtr | semmle.label | *call to ymlSourcePtr | +| test.cpp:426:22:426:33 | call to ymlSourcePtr | semmle.label | call to ymlSourcePtr | +| test.cpp:426:22:426:35 | **call to ymlSourcePtr | semmle.label | **call to ymlSourcePtr | +| test.cpp:427:11:427:24 | * ... | semmle.label | * ... | +| test.cpp:427:12:427:18 | *pointer [element] | semmle.label | *pointer [element] | +| test.cpp:437:11:437:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:437:11:437:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:438:3:438:3 | emplace output argument [element, x] | semmle.label | emplace output argument [element, x] | +| test.cpp:438:16:438:16 | *x | semmle.label | *x | +| test.cpp:440:34:440:34 | *c [element, x] | semmle.label | *c [element, x] | +| test.cpp:440:39:440:41 | call to get [x] | semmle.label | call to get [x] | +| test.cpp:440:39:440:41 | call to get [x] | semmle.label | call to get [x] | +| test.cpp:441:11:441:11 | *e [x] | semmle.label | *e [x] | +| test.cpp:441:13:441:13 | x | semmle.label | x | +| test.cpp:441:13:441:13 | x | semmle.label | x | +| test.cpp:446:3:446:28 | *ElementWithOverloadedArity [post update] [x] | semmle.label | *ElementWithOverloadedArity [post update] [x] | +| test.cpp:446:3:446:28 | *this [Return] [x] | semmle.label | *this [Return] [x] | +| test.cpp:446:34:446:38 | first | semmle.label | first | +| test.cpp:446:45:446:49 | first | semmle.label | first | +| test.cpp:447:3:447:28 | *ElementWithOverloadedArity [post update] [x] | semmle.label | *ElementWithOverloadedArity [post update] [x] | +| test.cpp:447:3:447:28 | *this [Return] [x] | semmle.label | *this [Return] [x] | +| test.cpp:447:39:447:44 | second | semmle.label | second | +| test.cpp:447:51:447:56 | second | semmle.label | second | +| test.cpp:451:11:451:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:451:11:451:19 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:454:5:454:5 | emplace output argument [element, x] | semmle.label | emplace output argument [element, x] | +| test.cpp:454:18:454:18 | *x | semmle.label | *x | +| test.cpp:455:13:455:13 | *c [element, x] | semmle.label | *c [element, x] | +| test.cpp:455:18:455:20 | *call to get [x] | semmle.label | *call to get [x] | +| test.cpp:455:21:455:21 | x | semmle.label | x | +| test.cpp:455:21:455:21 | x | semmle.label | x | +| test.cpp:464:5:464:5 | emplace output argument [element, x] | semmle.label | emplace output argument [element, x] | +| test.cpp:464:21:464:21 | *x | semmle.label | *x | +| test.cpp:465:13:465:13 | *c [element, x] | semmle.label | *c [element, x] | +| test.cpp:465:18:465:20 | *call to get [x] | semmle.label | *call to get [x] | +| test.cpp:465:21:465:21 | x | semmle.label | x | +| test.cpp:465:21:465:21 | x | semmle.label | x | +| test.cpp:472:5:472:5 | forward output argument | semmle.label | forward output argument | +| test.cpp:472:15:472:23 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:472:15:472:23 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:472:15:472:25 | call to ymlSource | semmle.label | call to ymlSource | +| test.cpp:473:13:473:13 | *f | semmle.label | *f | +| test.cpp:473:15:473:17 | call to get | semmle.label | call to get | +| test.cpp:473:15:473:17 | call to get | semmle.label | call to get | +| test.cpp:477:5:477:5 | forward output argument | semmle.label | forward output argument | +| test.cpp:477:15:477:26 | *call to ymlSourcePtr | semmle.label | *call to ymlSourcePtr | +| test.cpp:477:15:477:26 | call to ymlSourcePtr | semmle.label | call to ymlSourcePtr | +| test.cpp:477:15:477:28 | **call to ymlSourcePtr | semmle.label | **call to ymlSourcePtr | +| test.cpp:478:13:478:20 | * ... | semmle.label | * ... | +| test.cpp:478:14:478:14 | *f | semmle.label | *f | | windows.cpp:22:15:22:29 | *call to GetCommandLineA | semmle.label | *call to GetCommandLineA | | windows.cpp:22:15:22:29 | call to GetCommandLineA | semmle.label | call to GetCommandLineA | | windows.cpp:24:8:24:11 | * ... | semmle.label | * ... | @@ -3156,6 +3180,6 @@ subpaths | test.cpp:363:15:363:15 | *x | test.cpp:345:38:345:40 | arg | test.cpp:345:3:345:22 | *this [Return] [ul] | test.cpp:363:5:363:5 | forward output argument [ul] | | test.cpp:372:15:372:16 | *ul | test.cpp:341:30:341:32 | arg | test.cpp:341:3:341:22 | *this [Return] [s] | test.cpp:372:5:372:5 | forward output argument [s] | | test.cpp:372:15:372:16 | *ul | test.cpp:345:38:345:40 | arg | test.cpp:345:3:345:22 | *this [Return] [ul] | test.cpp:372:5:372:5 | forward output argument [ul] | -| test.cpp:443:18:443:18 | *x | test.cpp:435:34:435:38 | first | test.cpp:435:3:435:28 | *this [Return] [x] | test.cpp:443:5:443:5 | emplace output argument [element, x] | -| test.cpp:453:21:453:21 | *x | test.cpp:436:39:436:44 | second | test.cpp:436:3:436:28 | *this [Return] [x] | test.cpp:453:5:453:5 | emplace output argument [element, x] | +| test.cpp:454:18:454:18 | *x | test.cpp:446:34:446:38 | first | test.cpp:446:3:446:28 | *this [Return] [x] | test.cpp:454:5:454:5 | emplace output argument [element, x] | +| test.cpp:464:21:464:21 | *x | test.cpp:447:39:447:44 | second | test.cpp:447:3:447:28 | *this [Return] [x] | test.cpp:464:5:464:5 | emplace output argument [element, x] | testFailures diff --git a/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected b/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected index 48c1cc3a8707..7c498739e150 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/sinks.expected @@ -47,12 +47,14 @@ | test.cpp:367:15:367:16 | ul | test-sink | | test.cpp:375:15:375:15 | s | test-sink | | test.cpp:376:15:376:16 | ul | test-sink | -| test.cpp:399:13:399:13 | x | test-sink | -| test.cpp:407:13:407:13 | x | test-sink | -| test.cpp:416:13:416:13 | x | test-sink | -| test.cpp:430:13:430:13 | x | test-sink | -| test.cpp:444:21:444:21 | x | test-sink | -| test.cpp:449:21:449:21 | x | test-sink | -| test.cpp:454:21:454:21 | x | test-sink | -| test.cpp:462:15:462:17 | call to get | test-sink | -| test.cpp:467:13:467:20 | * ... | test-sink | +| test.cpp:400:13:400:13 | x | test-sink | +| test.cpp:408:13:408:13 | x | test-sink | +| test.cpp:417:13:417:13 | x | test-sink | +| test.cpp:423:18:423:20 | call to get | test-sink | +| test.cpp:427:11:427:24 | * ... | test-sink | +| test.cpp:441:13:441:13 | x | test-sink | +| test.cpp:455:21:455:21 | x | test-sink | +| test.cpp:460:21:460:21 | x | test-sink | +| test.cpp:465:21:465:21 | x | test-sink | +| test.cpp:473:15:473:17 | call to get | test-sink | +| test.cpp:478:13:478:20 | * ... | test-sink | diff --git a/cpp/ql/test/library-tests/dataflow/external-models/sources.expected b/cpp/ql/test/library-tests/dataflow/external-models/sources.expected index 1db34e2c7f32..9589477847a9 100644 --- a/cpp/ql/test/library-tests/dataflow/external-models/sources.expected +++ b/cpp/ql/test/library-tests/dataflow/external-models/sources.expected @@ -22,12 +22,13 @@ | test.cpp:317:51:317:59 | call to ymlSource | local | | test.cpp:362:15:362:23 | call to ymlSource | local | | test.cpp:371:24:371:32 | call to ymlSource | local | -| test.cpp:397:11:397:19 | call to ymlSource | local | -| test.cpp:404:11:404:19 | call to ymlSource | local | -| test.cpp:412:11:412:19 | call to ymlSource | local | -| test.cpp:426:11:426:19 | call to ymlSource | local | -| test.cpp:440:11:440:19 | call to ymlSource | local | -| test.cpp:461:15:461:23 | call to ymlSource | local | +| test.cpp:398:11:398:19 | call to ymlSource | local | +| test.cpp:405:11:405:19 | call to ymlSource | local | +| test.cpp:413:11:413:19 | call to ymlSource | local | +| test.cpp:422:21:422:29 | call to ymlSource | local | +| test.cpp:437:11:437:19 | call to ymlSource | local | +| test.cpp:451:11:451:19 | call to ymlSource | local | +| test.cpp:472:15:472:23 | call to ymlSource | local | | windows.cpp:22:15:22:29 | call to GetCommandLineA | local | | windows.cpp:34:17:34:38 | call to GetEnvironmentStringsA | local | | windows.cpp:39:36:39:38 | GetEnvironmentVariableA output argument | local |