]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: fix wrong dict param when getting dict type
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 12 Mar 2022 17:04:46 +0000 (00:04 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Mon, 14 Mar 2022 17:55:47 +0000 (17:55 +0000)
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 <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/noder/stencil.go
test/typeparam/mdempsky/13.go

index cd586cab78444ed2d96ce366124b488dfd21845a..c78a169d3106d6278c935ea3ea3814feb9d5c26d 100644 (file)
@@ -898,7 +898,7 @@ func getDictionaryType(info *instInfo, dictParam *ir.Name, pos src.XPos, i int)
                base.Fatalf(fmt.Sprintf("bad dict index %d", i))
        }
 
-       r := getDictionaryEntry(pos, info.dictParam, i, info.dictInfo.startSubDict)
+       r := getDictionaryEntry(pos, dictParam, i, info.dictInfo.startSubDict)
        // change type of retrieved dictionary entry to *byte, which is the
        // standard typing of a *runtime._type in the compiler
        typed(types.Types[types.TUINT8].PtrTo(), r)
index bf37a64177a994e2f7fa4f1e42e69fd523573cc5..8e11352b5148407f2f857bc2a836fca7d5192f3c 100644 (file)
@@ -1,4 +1,4 @@
-// run -gcflags=""
+// run
 
 // Copyright 2021 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style