Skip to content

Commit dcd81b5

Browse files
Make use of getContainer
1 parent d90fca3 commit dcd81b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

queries/undeclared-action-input.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ class ActionDeclaration extends File {
3636
}
3737

3838
Expr getAFunctionChildExpr(Function f) {
39-
result = f.getBody().getAChildStmt*().getAChildExpr*()
39+
result.getContainer() = f
4040
}
4141

4242
/*
4343
* Result is a function that is called from the body of the given function `f`
4444
*/
4545
Function calledBy(Function f) {
4646
result = getAFunctionChildExpr(f).(InvokeExpr).getResolvedCallee()
47+
or
48+
result.getEnclosingContainer() = f // assume outer function causes inner function to be called
4749
}
4850

4951
class GetInputMethodCallExpr extends MethodCallExpr {

0 commit comments

Comments
 (0)