Skip to content

Commit 57016dd

Browse files
committed
C++: Remove unique wrapper from DataFlow::Node::getEnclosingCallable()
1 parent 7d2a60e commit 57016dd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cpp/ql/src/semmle/code/cpp/dataflow/internal/DataFlowUtil.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Node extends TNode {
4646
/**
4747
* INTERNAL: Do not use. Alternative name for `getFunction`.
4848
*/
49-
final Function getEnclosingCallable() { result = unique(Function f | f = this.getFunction() | f) }
49+
final Function getEnclosingCallable() { result = this.getFunction() }
5050

5151
/** Gets the type of this node. */
5252
Type getType() { none() } // overridden in subclasses
@@ -715,6 +715,7 @@ private predicate exprToDefinitionByReferenceStep(Expr exprIn, Expr argOut) {
715715
}
716716

717717
private module FieldFlow {
718+
private import DataFlowImplCommon
718719
private import DataFlowImplLocal
719720
private import DataFlowPrivate
720721

@@ -747,7 +748,7 @@ private module FieldFlow {
747748
exists(FieldConfiguration cfg | cfg.hasFlow(node1, node2)) and
748749
// This configuration should not be able to cross function boundaries, but
749750
// we double-check here just to be sure.
750-
node1.getEnclosingCallable() = node2.getEnclosingCallable()
751+
getNodeEnclosingCallable(node1) = getNodeEnclosingCallable(node2)
751752
}
752753
}
753754

0 commit comments

Comments
 (0)