diff --git a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowUtil.qll b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowUtil.qll index b6ca8986307..ceeb4d64064 100644 --- a/java/ql/src/semmle/code/java/dataflow/internal/DataFlowUtil.qll +++ b/java/ql/src/semmle/code/java/dataflow/internal/DataFlowUtil.qll @@ -78,15 +78,19 @@ class Node extends TNode { result = this.(ImplicitPostUpdateNode).getPreUpdateNode().getType() } - /** Gets the callable in which this node occurs. */ - Callable getEnclosingCallable() { + private Callable getEnclosingCallableImpl() { result = this.asExpr().getEnclosingCallable() or result = this.asParameter().getCallable() or result = this.(ImplicitVarargsArray).getCall().getEnclosingCallable() or result = this.(InstanceParameterNode).getCallable() or result = this.(ImplicitInstanceAccess).getInstanceAccess().getEnclosingCallable() or result = this.(MallocNode).getClassInstanceExpr().getEnclosingCallable() or - result = this.(ImplicitPostUpdateNode).getPreUpdateNode().getEnclosingCallable() + result = this.(ImplicitPostUpdateNode).getPreUpdateNode().getEnclosingCallableImpl() + } + + /** Gets the callable in which this node occurs. */ + Callable getEnclosingCallable() { + result = unique(DataFlowCallable c | c = this.getEnclosingCallableImpl() | c) } private Type getImprovedTypeBound() {