mirror of
https://github.com/github/codeql.git
synced 2026-04-26 01:05:15 +02:00
Rust: Replace getBlockChildNode with uses of getStmtOrExpr.
This commit is contained in:
@@ -266,15 +266,8 @@ module ExprTrees {
|
||||
}
|
||||
}
|
||||
|
||||
private AstNode getBlockChildNode(BlockExpr b, int i) {
|
||||
result = b.getStmtList().getStatement(i)
|
||||
or
|
||||
i = b.getStmtList().getNumberOfStatements() and
|
||||
result = b.getStmtList().getTailExpr()
|
||||
}
|
||||
|
||||
class AsyncBlockExprTree extends StandardTree, PreOrderTree, PostOrderTree, AsyncBlockExpr {
|
||||
override AstNode getChildNode(int i) { result = getBlockChildNode(this, i) }
|
||||
override AstNode getChildNode(int i) { result = this.getStmtList().getStmtOrExpr(i) }
|
||||
|
||||
override predicate propagatesAbnormal(AstNode child) { none() }
|
||||
}
|
||||
@@ -282,7 +275,7 @@ module ExprTrees {
|
||||
class BlockExprTree extends StandardPostOrderTree, BlockExpr {
|
||||
BlockExprTree() { not this.isAsync() }
|
||||
|
||||
override AstNode getChildNode(int i) { result = getBlockChildNode(this, i) }
|
||||
override AstNode getChildNode(int i) { result = this.getStmtList().getStmtOrExpr(i) }
|
||||
|
||||
override predicate propagatesAbnormal(AstNode child) { child = this.getChildNode(_) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user