Skip to content

Commit 59170ee

Browse files
committed
C++: Use the optimized version of getAnUltimateDefinition in FlowSummaryImpl.qll.
1 parent 393512f commit 59170ee

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,23 @@ private module Input2 implements Impl::Private::InputSig2 {
171171
result = e.(ConversionCall).getQualifier().(LambdaExpression).getLambdaFunction()
172172
}
173173

174+
private module GetAnUltimateDefinitionInput implements Ssa::GetAnUltimateDefinitionSig {
175+
predicate isRelevantUltimateDefinition(Ssa::Definition def) {
176+
exists(
177+
getFunctionFromExpr(def.(Ssa::DirectExplicitDefinition)
178+
.getAssignedInstruction()
179+
.(StoreInstruction)
180+
.getSourceValue()
181+
.getUnconvertedResultExpression())
182+
)
183+
}
184+
}
185+
186+
private Ssa::Definition getAnUltimateDefinition(Ssa::Definition def) {
187+
result =
188+
Ssa::GetAnUltimateDefinition<GetAnUltimateDefinitionInput>::getAnUltimateDefinition(def)
189+
}
190+
174191
class SourceSinkReportingElement extends Element {
175192
SourceSinkReportingElement() { this instanceof Expr or this instanceof Parameter }
176193

@@ -191,7 +208,7 @@ private module Input2 implements Impl::Private::InputSig2 {
191208
exists(Ssa::Definition def |
192209
def.getAUse().getDef().getUnconvertedResultExpression() = this and
193210
result =
194-
getFunctionFromExpr(def.getAnUltimateDefinition()
211+
getFunctionFromExpr(getAnUltimateDefinition(def)
195212
.(Ssa::DirectExplicitDefinition)
196213
.getAssignedInstruction()
197214
.(StoreInstruction)

0 commit comments

Comments
 (0)