aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2026-02-04 15:29:40 -0800
committerKeith Randall <khr@golang.org>2026-02-04 17:48:06 -0800
commitb8bccb97982a7dc340f64d0ad522843418db8810 (patch)
tree270ad0e52dd4642da53bf1b3d173ce58b38b046f /src/cmd
parent513bb875bc77b2a516ac56f7710d8fbcd6ba6359 (diff)
downloadgo-b8bccb97982a7dc340f64d0ad522843418db8810.tar.xz
cmd/compile: don't double-walk the map argument of clear
mkcallstmt1 already walks the map argument of clear. mapClear then walks it again, which can cause problems if it is some syntax that is non-idempotent under walk. That is the case for the new way map lookups are being lowered in CL 736020. Fixes #77435 Change-Id: Ib2f6d7f2270308c2462aa276ed4413aaf7799fe3 Reviewed-on: https://go-review.googlesource.com/c/go/+/742120 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/compile/internal/walk/range.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/walk/range.go b/src/cmd/compile/internal/walk/range.go
index 866dd23def..e6a9a4bcfb 100644
--- a/src/cmd/compile/internal/walk/range.go
+++ b/src/cmd/compile/internal/walk/range.go
@@ -477,7 +477,7 @@ func mapClear(m, rtyp ir.Node) ir.Node {
// instantiate mapclear(typ *type, hmap map[any]any)
fn := typecheck.LookupRuntime("mapclear", t.Key(), t.Elem())
n := mkcallstmt1(fn, rtyp, m)
- return walkStmt(typecheck.Stmt(n))
+ return typecheck.Stmt(n)
}
// Lower n into runtime·memclr if possible, for