mirror of https://github.com/golang/go.git
cmd/internal/obj/arm: handle HAUTO etc. in addpool
HAUTO should be handled the same way as other stack offsets for adding to constant pool. Add the missing cases. Fixes #57955. Change-Id: If7fc82cafb2bbf0a6121e73e353b8825cb36b5bc Reviewed-on: https://go-review.googlesource.com/c/go/+/463138 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com>
This commit is contained in:
parent
c2e0bf0abf
commit
fdb3dc471d
|
|
@ -688,13 +688,16 @@ func (c *ctxt5) addpool(p *obj.Prog, a *obj.Addr) {
|
|||
t.Rel = p
|
||||
}
|
||||
|
||||
case C_SROREG,
|
||||
C_LOREG,
|
||||
C_ROREG,
|
||||
case C_HOREG,
|
||||
C_FOREG,
|
||||
C_HFOREG,
|
||||
C_SOREG,
|
||||
C_HOREG,
|
||||
C_ROREG,
|
||||
C_SROREG,
|
||||
C_LOREG,
|
||||
C_HAUTO,
|
||||
C_FAUTO,
|
||||
C_HFAUTO,
|
||||
C_SAUTO,
|
||||
C_LAUTO,
|
||||
C_LACON:
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
// 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.
|
||||
|
||||
// Issue 57955: ARM assembler fails to handle certain cases.
|
||||
|
||||
package main
|
||||
|
||||
func main() {
|
||||
Decode[int16](nil)
|
||||
Decode[uint16](nil)
|
||||
Decode[float64](nil)
|
||||
}
|
||||
|
||||
func DecodeInt16(b []byte) (int16, int) {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
func DecodeUint16(b []byte) (uint16, int) {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
func DecodeFloat64(b []byte) (float64, int) {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
func Decode[T any](b []byte) (T, int) {
|
||||
switch any(*new(T)).(type) {
|
||||
case int16:
|
||||
v, n := DecodeInt16(b)
|
||||
return any(v).(T), n
|
||||
case uint16:
|
||||
v, n := DecodeUint16(b)
|
||||
return any(v).(T), n
|
||||
case float64:
|
||||
v, n := DecodeFloat64(b)
|
||||
return any(v).(T), n
|
||||
default:
|
||||
panic("")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue