mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: fix confusion in generating SelectN index
Old: return the ABI register index of the result (wrong!) New: return the index w/in sequence of result registers (right!) Fixed bug: genCaller0/genCaller0.go:43:9: internal compiler error: 'Caller0': panic during schedule while compiling Caller0: runtime error: index out of range [10] with length 9 Updates #44816. Change-Id: I1111e283658a2d6422986ae3d61bd95d1b9bde5e Reviewed-on: https://go-review.googlesource.com/c/go/+/299549 Trust: David Chase <drchase@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
98dfdc82c8
commit
9f5298ca6e
1 changed files with 5 additions and 1 deletions
|
|
@ -424,7 +424,11 @@ func (x *expandState) rewriteSelect(leaf *Value, selector *Value, offset int64,
|
||||||
}
|
}
|
||||||
outParam := aux.abiInfo.OutParam(int(which))
|
outParam := aux.abiInfo.OutParam(int(which))
|
||||||
if len(outParam.Registers) > 0 {
|
if len(outParam.Registers) > 0 {
|
||||||
reg := int64(outParam.Registers[regOffset])
|
firstReg := uint32(0)
|
||||||
|
for i := 0; i < int(which); i++ {
|
||||||
|
firstReg += uint32(len(aux.abiInfo.OutParam(i).Registers))
|
||||||
|
}
|
||||||
|
reg := int64(regOffset + Abi1RO(firstReg))
|
||||||
if leaf.Block == call.Block {
|
if leaf.Block == call.Block {
|
||||||
leaf.reset(OpSelectN)
|
leaf.reset(OpSelectN)
|
||||||
leaf.SetArgs1(call0)
|
leaf.SetArgs1(call0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue