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) predicate outermostWrapperFunctionCall(Expr arg, string callChain)
{ {
exists(Function func, Call call, int argIndex | exists(Function targetFunc, Call call, int argIndex |
func = resolveCall(call) targetFunc = resolveCall(call)
and this.wrapperFunction(func, argIndex, callChain) and this.wrapperFunction(targetFunc, argIndex, callChain)
and not wrapperFunctionStep(call.getEnclosingFunction(), _, func, argIndex) and (
exists(Function sourceFunc | sourceFunc = call.getEnclosingFunction() |
not wrapperFunctionStep(sourceFunc, _, targetFunc, argIndex)
) or not exists(call.getEnclosingFunction())
)
and arg = call.getArgument(argIndex) and arg = call.getArgument(argIndex)
) )
} }