Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ private Function getFunction(string namespace, string type, boolean subtypes, st
elementSpec(namespace, type, subtypes, name, _, _) and
(
funcHasQualifiedName(result, namespace, name) and
subtypes = false and
subtypes = [true, false] and
type = ""
or
exists(Class namedClass, Class classWithMethod |
Expand Down Expand Up @@ -990,7 +990,7 @@ private Element interpretElement0(
elementSpec(namespace, type, subtypes, name, signature, _) and
signature = "" and
type = "" and
subtypes = false and
subtypes = [true, false] and
result = any(GlobalOrNamespaceVariable v | v.hasQualifiedName(namespace, name))
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| tests.cpp:296:6:296:21 | subtypeNonSource | Unexpected result: interpretElement |
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| tests.cpp:340:11:340:26 | call to subtypeNonSource | Unexpected result: ir |
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ invalidModelRow
| test.go:39:8:39:15 | call to Src1 | qltest |
| test.go:40:8:40:15 | call to Src2 | qltest |
| test.go:40:8:40:15 | call to Src2 | qltest-w-subtypes |
| test.go:41:8:41:16 | call to Src2 | qltest |
| test.go:41:8:41:16 | call to Src2 | qltest-w-subtypes |
| test.go:42:2:42:21 | ... = ...[0] | qltest |
| test.go:42:2:42:21 | ... = ...[1] | qltest-w-subtypes |
| test.go:43:2:43:22 | ... = ...[0] | qltest |
| test.go:43:2:43:22 | ... = ...[1] | qltest-w-subtypes |
| test.go:44:11:44:13 | arg [postupdate] | qltest-arg |
| test.go:59:9:59:16 | call to Src1 | qltest |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ invalidModelRow
| test.go:39:8:39:15 | call to Src1 | qltest |
| test.go:40:8:40:15 | call to Src2 | qltest |
| test.go:40:8:40:15 | call to Src2 | qltest-w-subtypes |
| test.go:41:8:41:16 | call to Src2 | qltest |
| test.go:41:8:41:16 | call to Src2 | qltest-w-subtypes |
| test.go:42:2:42:21 | ... = ...[0] | qltest |
| test.go:42:2:42:21 | ... = ...[1] | qltest-w-subtypes |
| test.go:43:2:43:22 | ... = ...[0] | qltest |
| test.go:43:2:43:22 | ... = ...[1] | qltest-w-subtypes |
| test.go:44:11:44:13 | arg [postupdate] | qltest-arg |
| test.go:59:9:59:16 | call to Src1 | qltest |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ invalidModelRow
| A.java:7:9:7:16 | src1(...) | qltest-alt |
| A.java:10:9:10:18 | src2(...) | qltest |
| A.java:10:9:10:18 | src2(...) | qltest-w-subtypes |
| A.java:11:9:11:18 | src3(...) | qltest |
| A.java:11:9:11:18 | src3(...) | qltest-w-subtypes |
| A.java:13:5:13:13 | this <.method> [post update] | qltest-argany |
| A.java:13:12:13:12 | x [post update] | qltest-argany |
Expand Down
31 changes: 18 additions & 13 deletions shared/mad/codeql/mad/static/ModelsAsData.qll
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,16 @@ module ModelsAsData<ExtensionsSig Extensions, InputSig Input> {
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string output, string kind, string provenance, string model
) {
subtypes = true and
exists(string namespaceOrGroup | namespace = getNamespace(namespaceOrGroup) |
exists(QlBuiltins::ExtensionId madId |
Extensions::sourceModel(namespaceOrGroup, type, subtypes, name, signature, ext, output,
kind, provenance, madId) and
Extensions::sourceModel(namespaceOrGroup, type, _, name, signature, ext, output, kind,
provenance, madId) and
model = "MaD:" + madId.toString()
)
or
Input::additionalSourceModel(namespaceOrGroup, type, subtypes, name, signature, ext, output,
kind, provenance, model)
Input::additionalSourceModel(namespaceOrGroup, type, _, name, signature, ext, output, kind,
provenance, model)
)
}

Expand All @@ -213,15 +214,16 @@ module ModelsAsData<ExtensionsSig Extensions, InputSig Input> {
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string input, string kind, string provenance, string model
) {
subtypes = true and
exists(string namespaceOrGroup | namespace = getNamespace(namespaceOrGroup) |
exists(QlBuiltins::ExtensionId madId |
Extensions::sinkModel(namespaceOrGroup, type, subtypes, name, signature, ext, input, kind,
Extensions::sinkModel(namespaceOrGroup, type, _, name, signature, ext, input, kind,
provenance, madId) and
model = "MaD:" + madId.toString()
)
or
Input::additionalSinkModel(namespaceOrGroup, type, subtypes, name, signature, ext, input,
kind, provenance, model)
Input::additionalSinkModel(namespaceOrGroup, type, _, name, signature, ext, input, kind,
provenance, model)
)
}

Expand All @@ -230,9 +232,10 @@ module ModelsAsData<ExtensionsSig Extensions, InputSig Input> {
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string output, string kind, string provenance, string model
) {
subtypes = true and
exists(string namespaceOrGroup, QlBuiltins::ExtensionId madId |
namespace = getNamespace(namespaceOrGroup) and
Extensions::barrierModel(namespaceOrGroup, type, subtypes, name, signature, ext, output, kind,
Extensions::barrierModel(namespaceOrGroup, type, _, name, signature, ext, output, kind,
provenance, madId) and
model = "MaD:" + madId.toString()
)
Expand All @@ -243,9 +246,10 @@ module ModelsAsData<ExtensionsSig Extensions, InputSig Input> {
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string input, string acceptingvalue, string kind, string provenance, string model
) {
subtypes = true and
exists(string namespaceOrGroup, QlBuiltins::ExtensionId madId |
namespace = getNamespace(namespaceOrGroup) and
Extensions::barrierGuardModel(namespaceOrGroup, type, subtypes, name, signature, ext, input,
Extensions::barrierGuardModel(namespaceOrGroup, type, _, name, signature, ext, input,
acceptingvalue, kind, provenance, madId) and
model = "MaD:" + madId.toString()
)
Expand All @@ -258,15 +262,16 @@ module ModelsAsData<ExtensionsSig Extensions, InputSig Input> {
string namespace, string type, boolean subtypes, string name, string signature, string ext,
string input, string output, string kind, string provenance, string model
) {
subtypes = true and
exists(string namespaceOrGroup | namespace = getNamespace(namespaceOrGroup) |
exists(QlBuiltins::ExtensionId madId |
Extensions::summaryModel(namespaceOrGroup, type, subtypes, name, signature, ext, input,
output, kind, provenance, madId) and
Extensions::summaryModel(namespaceOrGroup, type, _, name, signature, ext, input, output,
kind, provenance, madId) and
model = "MaD:" + madId.toString()
)
or
Input::additionalSummaryModel(namespaceOrGroup, type, subtypes, name, signature, ext, input,
output, kind, provenance, model)
Input::additionalSummaryModel(namespaceOrGroup, type, _, name, signature, ext, input, output,
kind, provenance, model)
)
}

Expand Down
Loading