mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Address comments
This commit is contained in:
@@ -1,24 +1,20 @@
|
||||
import codeql.ruby.controlflow.internal.ControlFlowGraphImplShared::Consistency
|
||||
import codeql.ruby.AST
|
||||
import codeql.ruby.controlflow.internal.Completion
|
||||
import codeql.ruby.controlflow.internal.ControlFlowGraphImpl
|
||||
|
||||
/**
|
||||
* All `Expr` nodes are `PostOrderTree`s
|
||||
*/
|
||||
query predicate nonPostOrderExprTypes(string cls) {
|
||||
exists(Expr e |
|
||||
e instanceof ControlFlowTree and
|
||||
not exists(e.getDesugared()) and
|
||||
cls = e.getAPrimaryQlClass() and
|
||||
not e instanceof PostOrderTree and
|
||||
not e instanceof LeafTree
|
||||
)
|
||||
or
|
||||
exists(Expr e |
|
||||
e instanceof ControlFlowTree and
|
||||
e = any(AstNode x).getDesugared() and
|
||||
cls = e.getAPrimaryQlClass() and
|
||||
not e instanceof PostOrderTree and
|
||||
not e instanceof LeafTree
|
||||
query predicate nonPostOrderExpr(Expr e, string cls) {
|
||||
cls = e.getPrimaryQlClasses() and
|
||||
not exists(e.getDesugared()) and
|
||||
not e instanceof BeginExpr and
|
||||
not e instanceof Namespace and
|
||||
not e instanceof Toplevel and
|
||||
exists(AstNode last, Completion c |
|
||||
last(e, last, c) and
|
||||
last != e and
|
||||
c instanceof NormalCompletion
|
||||
)
|
||||
}
|
||||
|
||||
@@ -399,6 +399,7 @@ module Trees {
|
||||
)
|
||||
or
|
||||
succ = this and
|
||||
c instanceof NormalCompletion and
|
||||
(
|
||||
last(this.getValue(), pred, c) and not exists(this.getABranch())
|
||||
or
|
||||
@@ -442,12 +443,12 @@ module Trees {
|
||||
)
|
||||
or
|
||||
succ = this and
|
||||
c instanceof NormalCompletion and
|
||||
(
|
||||
last(this.getABranch(), pred, c) and
|
||||
not c.(MatchingCompletion).getValue() = false
|
||||
or
|
||||
last(this.getElseBranch(), pred, c) and
|
||||
c instanceof NormalCompletion
|
||||
last(this.getElseBranch(), pred, c)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1166,6 +1167,7 @@ module Trees {
|
||||
)
|
||||
or
|
||||
last(this.getHandler(), pred, c) and
|
||||
c instanceof NormalCompletion and
|
||||
succ = this
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user