From 45ef41361add5231c5ed740e67026c09119b14ef Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Fri, 10 Jul 2026 15:06:15 +0100 Subject: [PATCH] Fix InitLiteralComponentInstruction.getRhs() for key-value pairs Key-value pairs are now expressions, but only the value is really written. --- go/ql/lib/semmle/go/controlflow/IR.qll | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/go/ql/lib/semmle/go/controlflow/IR.qll b/go/ql/lib/semmle/go/controlflow/IR.qll index a2eb3d89bd8..f4f7c4939d5 100644 --- a/go/ql/lib/semmle/go/controlflow/IR.qll +++ b/go/ql/lib/semmle/go/controlflow/IR.qll @@ -551,7 +551,8 @@ module IR { Instruction getBase() { result = evalExprInstruction(lit) } override Instruction getRhs() { - result = evalExprInstruction(elt) or + not elt instanceof KeyValueExpr and result = evalExprInstruction(elt) + or result = evalExprInstruction(elt.(KeyValueExpr).getValue()) }