mirror of
https://github.com/github/codeql.git
synced 2026-04-23 07:45:17 +02:00
Rust: Fix captured variable data flow inconsistency
This commit is contained in:
@@ -8,6 +8,7 @@ private import codeql.dataflow.DataFlow
|
||||
private import codeql.dataflow.internal.DataFlowImpl
|
||||
private import rust
|
||||
private import SsaImpl as SsaImpl
|
||||
private import codeql.rust.controlflow.internal.Scope as Scope
|
||||
private import codeql.rust.controlflow.ControlFlowGraph
|
||||
private import codeql.rust.controlflow.CfgNodes
|
||||
private import codeql.rust.dataflow.Ssa
|
||||
@@ -771,7 +772,12 @@ class LambdaCallKind = Unit;
|
||||
|
||||
/** Holds if `creation` is an expression that creates a lambda of kind `kind`. */
|
||||
private predicate lambdaCreationExpr(Expr creation, LambdaCallKind kind) {
|
||||
creation instanceof ClosureExpr and exists(kind)
|
||||
(
|
||||
creation instanceof ClosureExpr
|
||||
or
|
||||
creation instanceof Scope::AsyncBlockScope
|
||||
) and
|
||||
exists(kind)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
variableAccessAstNesting
|
||||
| test.rs:396:26:396:26 | b | test.rs:409:28:414:9 | { ... } | CapturedVariable access is not nested in the defining callable |
|
||||
| test.rs:409:23:409:25 | foo | test.rs:409:28:414:9 | { ... } | CapturedVariable access is not nested in the defining callable |
|
||||
consistencyOverview
|
||||
| CapturedVariable access is not nested in the defining callable | 2 |
|
||||
@@ -1,4 +0,0 @@
|
||||
variableAccessAstNesting
|
||||
| variables.rs:436:13:436:13 | i | variables.rs:437:17:439:5 | { ... } | CapturedVariable access is not nested in the defining callable |
|
||||
consistencyOverview
|
||||
| CapturedVariable access is not nested in the defining callable | 1 |
|
||||
Reference in New Issue
Block a user