From b55551f6acf039e857cf793b7275e518b99becec Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 22 Sep 2026 11:46:36 +0200 Subject: [PATCH] C#: Always strip implicit casts when getting value of expressions. --- csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll b/csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll index c8648741d011..f532aa6baf11 100644 --- a/csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll +++ b/csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll @@ -54,7 +54,7 @@ class Expr extends ControlFlowElement, @expr { final AnnotatedType getAnnotatedType() { result.appliesTo(this) } /** Gets the value of this expression, if any */ - string getValue() { expr_value(this, result) } + string getValue() { expr_value(this.stripImplicit(), result) } /** Gets the integer value of this expression, if any. */ cached