File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,47 @@ private module TrackVirtualDispatch<methodDispatchSig/1 lambdaDispatch0> {
281281 }
282282}
283283
284+ private DataFlowPrivate:: DataFlowCallable noDisp ( DataFlowPrivate:: DataFlowCall call ) { none ( ) }
285+
286+ pragma [ nomagic]
287+ private DataFlowPrivate:: DataFlowCallable d1 ( DataFlowPrivate:: DataFlowCall call ) {
288+ result = TrackVirtualDispatch< noDisp / 1 > :: lambdaDispatch ( call )
289+ }
290+
291+ pragma [ nomagic]
292+ private DataFlowPrivate:: DataFlowCallable d2 ( DataFlowPrivate:: DataFlowCall call ) {
293+ result = TrackVirtualDispatch< d1 / 1 > :: lambdaDispatch ( call )
294+ }
295+
296+ pragma [ nomagic]
297+ private DataFlowPrivate:: DataFlowCallable d3 ( DataFlowPrivate:: DataFlowCall call ) {
298+ result = TrackVirtualDispatch< d2 / 1 > :: lambdaDispatch ( call )
299+ }
300+
301+ pragma [ nomagic]
302+ private DataFlowPrivate:: DataFlowCallable d4 ( DataFlowPrivate:: DataFlowCall call ) {
303+ result = TrackVirtualDispatch< d3 / 1 > :: lambdaDispatch ( call )
304+ }
305+
306+ pragma [ nomagic]
307+ private DataFlowPrivate:: DataFlowCallable d5 ( DataFlowPrivate:: DataFlowCall call ) {
308+ result = TrackVirtualDispatch< d4 / 1 > :: lambdaDispatch ( call )
309+ }
310+
311+ pragma [ nomagic]
312+ private DataFlowPrivate:: DataFlowCallable d6 ( DataFlowPrivate:: DataFlowCall call ) {
313+ result = TrackVirtualDispatch< d5 / 1 > :: lambdaDispatch ( call )
314+ }
315+
316+ /** Gets a function that might be called by `call`. */
317+ cached
318+ DataFlowPrivate:: DataFlowCallable viableCallable ( DataFlowPrivate:: DataFlowCall call ) {
319+ not exists ( d6 ( call ) ) and
320+ result = nonVirtualDispatch ( call )
321+ or
322+ result = d6 ( call )
323+ }
324+
284325/**
285326 * Holds if the set of viable implementations that can be called by `call`
286327 * might be improved by knowing the call context.
You can’t perform that action at this time.
0 commit comments