diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/DerefChain.qll b/rust/ql/lib/codeql/rust/internal/typeinference/DerefChain.qll index 5c40f623f170..f71bb093c3b7 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/DerefChain.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/DerefChain.qll @@ -60,7 +60,10 @@ private module UnboundListInput implements UnboundListImpl::InputSig { class Element = DerefImplItemNode; - int getId(Element e) { idOfRaw(Synth::convertAstNodeToRaw(e), result) } + int getId(Element e) { + CachedStage::ref() and + idOfRaw(Synth::convertAstNodeToRaw(e), result) + } string getElementString(Element e) { result = e.resolveSelfTy().getName() } diff --git a/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll b/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll index d591c947e124..a6d0859ce475 100644 --- a/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll +++ b/rust/ql/lib/codeql/rust/internal/typeinference/TypeInference.qll @@ -36,6 +36,7 @@ private module Input1 implements InputSig1 { class TypeAbstraction = TA::TypeAbstraction; int getTypeParameterId(TypeParameter tp) { + CachedStage::ref() and tp = rank[result](TypeParameter tp0, int kind, int id1, int id2 | kind = 1 and diff --git a/shared/util/codeql/util/UnboundList.qll b/shared/util/codeql/util/UnboundList.qll index 622895a6bd01..1d0ce06d7a82 100644 --- a/shared/util/codeql/util/UnboundList.qll +++ b/shared/util/codeql/util/UnboundList.qll @@ -52,6 +52,7 @@ module Make Input> { /** Gets the rank of element `e`, which is used internally in the string encoding. */ int getRank(Element e) { e = DenseRank::denseRank(result) } + cached private string encode(Element e) { result = getRank(e).toString() } bindingset[s]