From 439a67a3feb656dcc34ba3bbf15e18f42980b3b1 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Fri, 1 May 2026 10:26:50 +0200 Subject: [PATCH] C#: Fix toString for capture definitions. --- csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll index 7d49e0b27d1..fc640cccf77 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/SSA.qll @@ -569,6 +569,15 @@ module Ssa { override string toString() { result = SsaImpl::ParameterDefinitionImpl.super.toString() } } + /** An SSA definition in a closure that captures a variable. */ + class SsaCapturedDefinition extends SsaImplicitEntryDefinition { + SsaCapturedDefinition() { + this.getSourceVariable().getAssignable() instanceof LocalScopeVariable + } + + override string toString() { result = "SSA capture def(" + this.getSourceVariable() + ")" } + } + /** * An SSA definition representing the potential definition of a variable * via a call.