mirror of
https://github.com/golang/go
synced 2024-11-26 01:57:56 -07:00
cmd/compile: fix wrong argument of OpSelectN during expand_calls
Fixes #63462 Change-Id: I5ddf831eab630e23156f8f27a079b4ca4bb3a261 Reviewed-on: https://go-review.googlesource.com/c/go/+/533795 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com>
This commit is contained in:
parent
fce6be15cc
commit
ad9e6edfdd
@ -142,6 +142,10 @@ func expandCalls(f *Func) {
|
||||
call := v.Args[0]
|
||||
aux := call.Aux.(*AuxCall)
|
||||
mem := x.memForCall[call.ID]
|
||||
if mem == nil {
|
||||
mem = call.Block.NewValue1I(call.Pos, OpSelectN, types.TypeMem, int64(aux.abiInfo.OutRegistersUsed()), call)
|
||||
x.memForCall[call.ID] = mem
|
||||
}
|
||||
|
||||
i := v.AuxInt
|
||||
regs := aux.RegsOfResult(i)
|
||||
|
18
test/fixedbugs/issue63462.go
Normal file
18
test/fixedbugs/issue63462.go
Normal file
@ -0,0 +1,18 @@
|
||||
// compile
|
||||
|
||||
// Copyright 2023 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package p
|
||||
|
||||
func f() {
|
||||
for b := "" < join([]string{}, "") && true; ; {
|
||||
_ = b
|
||||
}
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func join(elems []string, sep string) string {
|
||||
return ""
|
||||
}
|
Loading…
Reference in New Issue
Block a user