FunctionsWithWrappers: Simplify/tidy library.

This commit is contained in:
Pavel Avgustinov
2018-08-14 17:16:15 -07:00
parent 031964e853
commit d999ada22c

View File

@@ -139,10 +139,14 @@ abstract class FunctionWithWrappers extends Function {
*/
predicate outermostWrapperFunctionCall(Expr arg, string callChain)
{
exists(Function func, Call call, int argIndex |
func = resolveCall(call)
and this.wrapperFunction(func, argIndex, callChain)
and not wrapperFunctionStep(call.getEnclosingFunction(), _, func, argIndex)
exists(Function targetFunc, Call call, int argIndex |
targetFunc = resolveCall(call)
and this.wrapperFunction(targetFunc, argIndex, callChain)
and (
exists(Function sourceFunc | sourceFunc = call.getEnclosingFunction() |
not wrapperFunctionStep(sourceFunc, _, targetFunc, argIndex)
) or not exists(call.getEnclosingFunction())
)
and arg = call.getArgument(argIndex)
)
}