Use Generated::AstNode in ExprChildMapping

This commit is contained in:
Tom Hvitved
2021-02-09 19:32:41 +01:00
parent 1e64b264ba
commit 9cfc08319d
2 changed files with 4 additions and 4 deletions

View File

@@ -11,8 +11,6 @@ private import codeql_ruby.controlflow.internal.ControlFlowGraphImpl
class Stmt extends AstNode {
override Stmt::Range range;
Stmt() { this = range }
/** Gets a control-flow node for this statement, if any. */
CfgNodes::AstCfgNode getAControlFlowNode() { result.getNode() = this }

View File

@@ -135,14 +135,16 @@ abstract private class ExprChildMapping extends Expr {
*/
abstract predicate relevantChild(Expr child);
private AstNode getAChildStar() {
private Generated::AstNode getAChildStar() {
result = this
or
result.(Generated::AstNode).getParent() = this.getAChildStar()
}
pragma[noinline]
private BasicBlock getABasicBlockInScope() { result.getANode().getNode() = this.getAChildStar() }
private BasicBlock getABasicBlockInScope() {
result.getANode() = TAstNode(this.getAChildStar(), _)
}
pragma[nomagic]
private predicate reachesBasicBlockBase(Expr child, CfgNode cfn, BasicBlock bb) {