From 88198d75dff91b3b3720d45478ed1dc7e6b6ca72 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Fri, 9 Oct 2026 10:50:25 +0200 Subject: [PATCH 1/3] Unified: Allow pattern-less parameters. --- unified/ql/lib/codeql/unified/internal/ControlFlowGraph.qll | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unified/ql/lib/codeql/unified/internal/ControlFlowGraph.qll b/unified/ql/lib/codeql/unified/internal/ControlFlowGraph.qll index 313feb1a145d..868b74b4023c 100644 --- a/unified/ql/lib/codeql/unified/internal/ControlFlowGraph.qll +++ b/unified/ql/lib/codeql/unified/internal/ControlFlowGraph.qll @@ -56,7 +56,11 @@ module Ast implements AstSig { class Parameter extends U::Parameter { Expr getDefaultValue() { result = super.getDefault() } - AstNode getPattern() { result = super.getPattern() } + AstNode getPattern() { + result = super.getPattern() + or + not exists(super.getPattern()) and result = this + } } Parameter callableGetParameter(Callable c, int index) { From 5b98c6c980b32c0c78c48478020ff69675f3c8c5 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Fri, 9 Oct 2026 11:07:17 +0200 Subject: [PATCH 2/3] Unified: Accept test improvements. --- .../BasicTest/CONSISTENCY/CfgConsistency.expected | 5 ----- .../dataflow/CONSISTENCY/CfgConsistency.expected | 5 ----- .../local-name-binding/CONSISTENCY/CfgConsistency.expected | 5 ----- .../CONSISTENCY/CfgConsistency.expected | 4 ---- .../type-inference/CONSISTENCY/CfgConsistency.expected | 7 ------- .../PathInjection/CONSISTENCY/CfgConsistency.expected | 4 ---- 6 files changed, 30 deletions(-) delete mode 100644 unified/ql/test/library-tests/dataflow/CONSISTENCY/CfgConsistency.expected diff --git a/unified/ql/test/library-tests/BasicTest/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/library-tests/BasicTest/CONSISTENCY/CfgConsistency.expected index eaa376774829..e69de29bb2d1 100644 --- a/unified/ql/test/library-tests/BasicTest/CONSISTENCY/CfgConsistency.expected +++ b/unified/ql/test/library-tests/BasicTest/CONSISTENCY/CfgConsistency.expected @@ -1,5 +0,0 @@ -consistencyOverview -| deadEnd | 2 | -deadEnd -| test.swift:59:10:59:25 | Entry | -| test.swift:60:10:60:25 | Entry | diff --git a/unified/ql/test/library-tests/dataflow/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/library-tests/dataflow/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index ae1fa85c4383..000000000000 --- a/unified/ql/test/library-tests/dataflow/CONSISTENCY/CfgConsistency.expected +++ /dev/null @@ -1,5 +0,0 @@ -consistencyOverview -| deadEnd | 2 | -deadEnd -| enums.swift:7:10:7:22 | Entry | -| enums.swift:8:10:8:22 | Entry | diff --git a/unified/ql/test/library-tests/local-name-binding/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/library-tests/local-name-binding/CONSISTENCY/CfgConsistency.expected index f125f6b6d4f7..e69de29bb2d1 100644 --- a/unified/ql/test/library-tests/local-name-binding/CONSISTENCY/CfgConsistency.expected +++ b/unified/ql/test/library-tests/local-name-binding/CONSISTENCY/CfgConsistency.expected @@ -1,5 +0,0 @@ -consistencyOverview -| deadEnd | 2 | -deadEnd -| test.swift:341:10:341:15 | Entry | -| test.swift:342:10:342:15 | Entry | diff --git a/unified/ql/test/library-tests/static-name-binding/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/library-tests/static-name-binding/CONSISTENCY/CfgConsistency.expected index 943f915914c2..e69de29bb2d1 100644 --- a/unified/ql/test/library-tests/static-name-binding/CONSISTENCY/CfgConsistency.expected +++ b/unified/ql/test/library-tests/static-name-binding/CONSISTENCY/CfgConsistency.expected @@ -1,4 +0,0 @@ -consistencyOverview -| deadEnd | 1 | -deadEnd -| generics.swift:3:10:3:17 | Entry | diff --git a/unified/ql/test/library-tests/type-inference/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/library-tests/type-inference/CONSISTENCY/CfgConsistency.expected index f54308ecd5ef..e69de29bb2d1 100644 --- a/unified/ql/test/library-tests/type-inference/CONSISTENCY/CfgConsistency.expected +++ b/unified/ql/test/library-tests/type-inference/CONSISTENCY/CfgConsistency.expected @@ -1,7 +0,0 @@ -consistencyOverview -| deadEnd | 4 | -deadEnd -| generics.swift:46:8:46:17 | Entry | -| generics.swift:47:8:47:22 | Entry | -| pattern_matching.swift:9:8:9:15 | Entry | -| pattern_matching.swift:10:8:10:34 | Entry | diff --git a/unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/CfgConsistency.expected index b7d75c0421ae..e69de29bb2d1 100644 --- a/unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/CfgConsistency.expected +++ b/unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/CfgConsistency.expected @@ -1,4 +0,0 @@ -consistencyOverview -| deadEnd | 1 | -deadEnd -| testPathInjection.swift:330:14:330:62 | Entry | From 4881edc3a2d432fe644b4c52f4e5f86cbdfc2617 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Fri, 9 Oct 2026 12:24:38 +0200 Subject: [PATCH 3/3] Unified: delete empty consistency expected files. --- .../library-tests/BasicTest/CONSISTENCY/CfgConsistency.expected | 0 .../BasicTest/CONSISTENCY/LocalSsaConsistency.expected | 0 .../constructors/CONSISTENCY/LocalSsaConsistency.expected | 0 .../controlflow/CONSISTENCY/LocalSsaConsistency.expected | 0 .../dataflow/CONSISTENCY/LocalSsaConsistency.expected | 0 .../local-name-binding/CONSISTENCY/CfgConsistency.expected | 0 .../library-tests/mad/CONSISTENCY/LocalSsaConsistency.expected | 0 .../static-name-binding/CONSISTENCY/CfgConsistency.expected | 0 .../type-inference/CONSISTENCY/CfgConsistency.expected | 0 .../type-inference/CONSISTENCY/LocalSsaConsistency.expected | 0 .../CWE-022/PathInjection/CONSISTENCY/CfgConsistency.expected | 0 .../PathInjection/CONSISTENCY/LocalSsaConsistency.expected | 0 12 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 unified/ql/test/library-tests/BasicTest/CONSISTENCY/CfgConsistency.expected delete mode 100644 unified/ql/test/library-tests/BasicTest/CONSISTENCY/LocalSsaConsistency.expected delete mode 100644 unified/ql/test/library-tests/constructors/CONSISTENCY/LocalSsaConsistency.expected delete mode 100644 unified/ql/test/library-tests/controlflow/CONSISTENCY/LocalSsaConsistency.expected delete mode 100644 unified/ql/test/library-tests/dataflow/CONSISTENCY/LocalSsaConsistency.expected delete mode 100644 unified/ql/test/library-tests/local-name-binding/CONSISTENCY/CfgConsistency.expected delete mode 100644 unified/ql/test/library-tests/mad/CONSISTENCY/LocalSsaConsistency.expected delete mode 100644 unified/ql/test/library-tests/static-name-binding/CONSISTENCY/CfgConsistency.expected delete mode 100644 unified/ql/test/library-tests/type-inference/CONSISTENCY/CfgConsistency.expected delete mode 100644 unified/ql/test/library-tests/type-inference/CONSISTENCY/LocalSsaConsistency.expected delete mode 100644 unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/CfgConsistency.expected delete mode 100644 unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/LocalSsaConsistency.expected diff --git a/unified/ql/test/library-tests/BasicTest/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/library-tests/BasicTest/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/library-tests/BasicTest/CONSISTENCY/LocalSsaConsistency.expected b/unified/ql/test/library-tests/BasicTest/CONSISTENCY/LocalSsaConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/library-tests/constructors/CONSISTENCY/LocalSsaConsistency.expected b/unified/ql/test/library-tests/constructors/CONSISTENCY/LocalSsaConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/library-tests/controlflow/CONSISTENCY/LocalSsaConsistency.expected b/unified/ql/test/library-tests/controlflow/CONSISTENCY/LocalSsaConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/library-tests/dataflow/CONSISTENCY/LocalSsaConsistency.expected b/unified/ql/test/library-tests/dataflow/CONSISTENCY/LocalSsaConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/library-tests/local-name-binding/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/library-tests/local-name-binding/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/library-tests/mad/CONSISTENCY/LocalSsaConsistency.expected b/unified/ql/test/library-tests/mad/CONSISTENCY/LocalSsaConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/library-tests/static-name-binding/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/library-tests/static-name-binding/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/library-tests/type-inference/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/library-tests/type-inference/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/library-tests/type-inference/CONSISTENCY/LocalSsaConsistency.expected b/unified/ql/test/library-tests/type-inference/CONSISTENCY/LocalSsaConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/CfgConsistency.expected b/unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/CfgConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/LocalSsaConsistency.expected b/unified/ql/test/query-tests/security/CWE-022/PathInjection/CONSISTENCY/LocalSsaConsistency.expected deleted file mode 100644 index e69de29bb2d1..000000000000