File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ private import codeql.rust.dataflow.FlowBarrier
5858private import codeql.rust.dataflow.FlowSummary
5959private import codeql.rust.dataflow.FlowSource
6060private import codeql.rust.dataflow.FlowSink
61+ private import codeql.rust.internal.CachedStages
6162private import codeql.rust.internal.typeinference.FunctionType
6263private import codeql.rust.internal.typeinference.TypeMention
6364private import codeql.rust.frameworks.stdlib.Stdlib
@@ -215,7 +216,9 @@ private class SummarizedCallableFromModel extends SummarizedCallable::Range {
215216 * add a flow model that achieves the effect of simulating that the callback is
216217 * invoked, which is needed for flow through captured variables to work.
217218 */
218- private predicate mayInvokeCallback ( Function f , int n ) {
219+ cached
220+ predicate mayInvokeCallback ( Function f , int n ) {
221+ Stages:: TypeInferenceStage:: ref ( ) and
219222 exists ( TypeMention tm , Trait trait |
220223 tm = f .getParam ( n ) .getTypeRepr ( ) and
221224 trait = getALookupTrait ( f , tm .getType ( ) ) and
Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ module Stages {
130130 module TypeInferenceStage {
131131 private import codeql.rust.internal.typeinference.Type
132132 private import codeql.rust.internal.typeinference.TypeInference
133+ private import codeql.rust.dataflow.internal.ModelsAsData
133134
134135 /**
135136 * Always holds.
@@ -150,6 +151,8 @@ module Stages {
150151 exists ( Type t )
151152 or
152153 exists ( inferType ( _) )
154+ or
155+ mayInvokeCallback ( _, _)
153156 }
154157 }
155158
You can’t perform that action at this time.
0 commit comments