From 659ce6f1caa2c6ec6607fcf9992a4f5aa4fdbb72 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Fri, 11 Oct 2024 13:45:10 +0200 Subject: [PATCH] Rust: fix CodeQL alert --- .../codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll index 92124ee17c0c..d132ac525c5c 100644 --- a/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll +++ b/rust/ql/lib/codeql/rust/controlflow/internal/ControlFlowGraphImpl.qll @@ -413,7 +413,9 @@ class MacroCallTree extends ControlFlowTree instanceof MacroCall { override predicate last(AstNode last, Completion c) { last(super.getExpanded(), last, c) or - not exists(super.getExpanded()) and last = this + not exists(super.getExpanded()) and + last = this and + completionIsValidFor(c, last) } override predicate succ(AstNode pred, AstNode succ, Completion c) { none() }