Skip to content

Commit 5fd1c6f

Browse files
committed
C++: Remove parameter from predicate for some tiny performance benefits
1 parent 7753129 commit 5fd1c6f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowDispatch.qll

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private module VirtualDispatch {
9898
.getObjectAddress()
9999
.(VariableAddressInstruction)
100100
.getASTVariable() and
101-
this.flowsFromGlobalUnionField(var, _, a)
101+
this.flowsFromGlobalUnionField(var, a)
102102
)
103103
) and
104104
allowFromArg = true
@@ -112,11 +112,10 @@ private module VirtualDispatch {
112112
)
113113
}
114114

115-
private predicate flowsFromGlobalUnionField(Variable var, Field f, FieldAccess a) {
116-
f.getDeclaringType() instanceof Union and
115+
private predicate flowsFromGlobalUnionField(Variable var, FieldAccess a) {
116+
a.getTarget().getDeclaringType() instanceof Union and
117117
exists(LoadInstruction load |
118118
this.flowsFrom(DataFlow::instructionNode(load), _) and
119-
a.getTarget() = f and
120119
load
121120
.getSourceAddress()
122121
.(FieldAddressInstruction)

0 commit comments

Comments
 (0)