Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions unified/ql/lib/codeql/unified/internal/ControlFlowGraph.qll
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ private module Ast implements AstSig<Location> {
e instanceof Modifier
or
e instanceof Identifier and not e instanceof IdentifierExpr
or
e instanceof Operator
}

AstNode getChild(AstNode n, int index) {
Expand All @@ -38,6 +40,8 @@ private module Ast implements AstSig<Location> {
not n instanceof Callable and
not skipControlFlow(n) and
not skipControlFlow(result)
or
n.(FunctionExpr).getCaptureDeclaration(index) = result
}

Callable getEnclosingCallable(AstNode node) { result = node.getEnclosingCallable() }
Expand Down Expand Up @@ -71,14 +75,12 @@ private module Ast implements AstSig<Location> {
Expr getExpr() { none() }
}

class IfStmt extends Stmt {
IfStmt() { none() }

Expr getCondition() { none() }
class IfStmt extends Stmt instanceof U::GuardIfStmt {
Expr getCondition() { result = super.getCondition() }

Stmt getThen() { none() }

Stmt getElse() { none() }
Stmt getElse() { result = super.getElse() }
}

abstract class LoopStmt extends Stmt {
Expand Down
Loading
Loading