mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: Weaken scopeNoFirst check
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import rust
|
import rust
|
||||||
import codeql.rust.controlflow.internal.ControlFlowGraphImpl::Consistency
|
import codeql.rust.controlflow.internal.ControlFlowGraphImpl::Consistency as Consistency
|
||||||
|
import Consistency
|
||||||
|
import codeql.rust.controlflow.ControlFlowGraph
|
||||||
import codeql.rust.controlflow.internal.ControlFlowGraphImpl as CfgImpl
|
import codeql.rust.controlflow.internal.ControlFlowGraphImpl as CfgImpl
|
||||||
import codeql.rust.controlflow.internal.Completion
|
import codeql.rust.controlflow.internal.Completion
|
||||||
|
|
||||||
@@ -17,3 +19,9 @@ query predicate nonPostOrderExpr(Expr e, string cls) {
|
|||||||
c instanceof NormalCompletion
|
c instanceof NormalCompletion
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
query predicate scopeNoFirst(CfgScope scope) {
|
||||||
|
Consistency::scopeNoFirst(scope) and
|
||||||
|
not scope = any(Function f | not exists(f.getBody())) and
|
||||||
|
not scope = any(ClosureExpr c | not exists(c.getBody()))
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
/**
|
|
||||||
* @id rust/controlflow/cfg
|
|
||||||
*/
|
|
||||||
|
|
||||||
import rust
|
import rust
|
||||||
import codeql.rust.controlflow.ControlFlowGraph
|
import codeql.rust.controlflow.ControlFlowGraph
|
||||||
import TestUtils
|
import TestUtils
|
||||||
|
|||||||
Reference in New Issue
Block a user