From dcd81b5847b81489052bf4eb6e7accdc2d6df8ab Mon Sep 17 00:00:00 2001 From: Robert Brignull Date: Mon, 4 May 2020 15:16:23 +0100 Subject: [PATCH] Make use of getContainer --- queries/undeclared-action-input.ql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/queries/undeclared-action-input.ql b/queries/undeclared-action-input.ql index 23627205b..a8ec7c3f4 100644 --- a/queries/undeclared-action-input.ql +++ b/queries/undeclared-action-input.ql @@ -36,7 +36,7 @@ class ActionDeclaration extends File { } Expr getAFunctionChildExpr(Function f) { - result = f.getBody().getAChildStmt*().getAChildExpr*() + result.getContainer() = f } /* @@ -44,6 +44,8 @@ Expr getAFunctionChildExpr(Function f) { */ Function calledBy(Function f) { result = getAFunctionChildExpr(f).(InvokeExpr).getResolvedCallee() + or + result.getEnclosingContainer() = f // assume outer function causes inner function to be called } class GetInputMethodCallExpr extends MethodCallExpr {