From a9f60faca2851d82cde17265eb74b53e650125ea Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Mon, 31 Aug 2026 09:47:39 +0200 Subject: [PATCH 1/2] CFG: Exclude blocks from post-order in case they're Exprs. --- shared/controlflow/codeql/controlflow/ControlFlowGraph.qll | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll index d230990ce45d..9c0f32fee397 100644 --- a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll +++ b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll @@ -571,7 +571,8 @@ module Make0 Ast> { not n instanceof LogicalNotExpr and not n instanceof ConditionalExpr and not n instanceof Switch and - not n instanceof Case + not n instanceof Case and + not n instanceof BlockStmt } /** From 61e11ebcde43d3ca71441f45663a73b17b2dafef Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Tue, 1 Sep 2026 10:01:22 +0200 Subject: [PATCH 2/2] CFG: Exclude 'try's from post-order in case they're Exprs. --- shared/controlflow/codeql/controlflow/ControlFlowGraph.qll | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll index 9c0f32fee397..21bdcf5b8335 100644 --- a/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll +++ b/shared/controlflow/codeql/controlflow/ControlFlowGraph.qll @@ -572,7 +572,8 @@ module Make0 Ast> { not n instanceof ConditionalExpr and not n instanceof Switch and not n instanceof Case and - not n instanceof BlockStmt + not n instanceof BlockStmt and + not n instanceof TryStmt } /**