Apply suggestions from code review

Co-authored-by: Esben Sparre Andreasen <esbena@github.com>
This commit is contained in:
Erik Krogh Kristensen
2020-09-22 10:06:34 +02:00
parent 4243504c8b
commit ec49c444ef

View File

@@ -243,17 +243,19 @@ module HTTP {
exists(int i, DataFlow::FunctionNode outer, HTTP::RouteHandlerCandidate inner |
decoratee = call.getArgument(i).getALocalSource() and
outer.getFunction() = call.getACallee() and
outer = returnsARouteHandler(inner) and
returnsRouteHandler(outer, inner) and
isAForwardingRouteHandlerCall(outer.getParameter(i), inner)
)
}
/**
* Gets a function that returns the route-handler-candidate `routeHandler`.
* Holds if `fun` returns the route-handler-candidate `routeHandler`.
*/
pragma[noinline]
private DataFlow::FunctionNode returnsARouteHandler(HTTP::RouteHandlerCandidate routeHandler) {
routeHandler = result.getAReturn().getALocalSource()
private predicate returnsRouteHandler(
DataFlow::FunctionNode fun, HTTP::RouteHandlerCandidate routeHandler
) {
routeHandler = fun.getAReturn().getALocalSource()
}
/**