Skip to content

Commit 8419ec2

Browse files
committed
cmd/compile: fix wrong dict param when getting dict type
CL 338129 added getDictionaryType to get the dictionary type from the specified dict param, but still using the one in info.dictParam, which is wrong. Fixes #51413 Change-Id: Ie13460c1e5751c4c5fc44479a44f6eed8b3b06e4 Reviewed-on: https://go-review.googlesource.com/c/go/+/391994 Trust: Cuong Manh Le <[email protected]> Run-TryBot: Cuong Manh Le <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Trust: Matthew Dempsky <[email protected]> Reviewed-by: Keith Randall <[email protected]>
1 parent 676858f commit 8419ec2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cmd/compile/internal/noder/stencil.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ func getDictionaryType(info *instInfo, dictParam *ir.Name, pos src.XPos, i int)
898898
base.Fatalf(fmt.Sprintf("bad dict index %d", i))
899899
}
900900

901-
r := getDictionaryEntry(pos, info.dictParam, i, info.dictInfo.startSubDict)
901+
r := getDictionaryEntry(pos, dictParam, i, info.dictInfo.startSubDict)
902902
// change type of retrieved dictionary entry to *byte, which is the
903903
// standard typing of a *runtime._type in the compiler
904904
typed(types.Types[types.TUINT8].PtrTo(), r)

test/typeparam/mdempsky/13.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run -gcflags=""
1+
// run
22

33
// Copyright 2021 The Go Authors. All rights reserved.
44
// Use of this source code is governed by a BSD-style

0 commit comments

Comments
 (0)