diff options
author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2020-11-24 00:58:00 +0700 |
---|---|---|
committer | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2020-11-24 03:06:15 +0000 |
commit | 7dc5d909fb465345bf1583eb978aaa56ca365f38 (patch) | |
tree | 9278347c34dbc18ebb208e76121ef1c9367a0522 /src | |
parent | 762eda346a9f4062feaa8a9fc0d17d72b11586f0 (diff) | |
download | go-git-7dc5d909fb465345bf1583eb978aaa56ca365f38.tar.gz |
cmd/compile: set OpLoad argument type interface{} correctly
CL 271906 allows loading single field of typed-interface{} OpIData, but
it does not update the corresponding selector type. So the generated
OpLoad has the named type instead, prevent it from being lowered by
lower pass.
Fixes #42784
Change-Id: Idf32e4f711731be09d508dd712b60bc8c58309bd
Reviewed-on: https://go-review.googlesource.com/c/go/+/272466
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd/compile/internal/ssa/expand_calls.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/expand_calls.go b/src/cmd/compile/internal/ssa/expand_calls.go index 180afab33b..f266e49327 100644 --- a/src/cmd/compile/internal/ssa/expand_calls.go +++ b/src/cmd/compile/internal/ssa/expand_calls.go @@ -250,6 +250,9 @@ func expandCalls(f *Func) { if leafType != selector.Type && !selector.Type.IsEmptyInterface() { // empty interface for #42727 f.Fatalf("Unexpected Load as selector, leaf=%s, selector=%s\n", leaf.LongString(), selector.LongString()) } + if selector.Type.IsEmptyInterface() { + selector.Type = typ.BytePtr + } leaf.copyOf(selector) for _, s := range namedSelects[selector] { locs = append(locs, f.Names[s.locIndex]) |