File tree Expand file tree Collapse file tree
lib/codeql/unified/internal
test/library-tests/controlflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ private module Ast implements AstSig<Location> {
3030 e instanceof Modifier
3131 or
3232 e instanceof Identifier and not e instanceof IdentifierExpr
33+ or
34+ e instanceof Operator
3335 }
3436
3537 AstNode getChild ( AstNode n , int index ) {
@@ -38,6 +40,8 @@ private module Ast implements AstSig<Location> {
3840 not n instanceof Callable and
3941 not skipControlFlow ( n ) and
4042 not skipControlFlow ( result )
43+ or
44+ n .( FunctionExpr ) .getCaptureDeclaration ( index ) = result
4145 }
4246
4347 Callable getEnclosingCallable ( AstNode node ) { result = node .getEnclosingCallable ( ) }
@@ -71,14 +75,12 @@ private module Ast implements AstSig<Location> {
7175 Expr getExpr ( ) { none ( ) }
7276 }
7377
74- class IfStmt extends Stmt {
75- IfStmt ( ) { none ( ) }
76-
77- Expr getCondition ( ) { none ( ) }
78+ class IfStmt extends Stmt instanceof U:: GuardIfStmt {
79+ Expr getCondition ( ) { result = super .getCondition ( ) }
7880
7981 Stmt getThen ( ) { none ( ) }
8082
81- Stmt getElse ( ) { none ( ) }
83+ Stmt getElse ( ) { result = super . getElse ( ) }
8284 }
8385
8486 abstract class LoopStmt extends Stmt {
You can’t perform that action at this time.
0 commit comments