]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/riscv: add check for invalid shift amount input
authorWayne Zuo <wdvxdr@golangcn.org>
Thu, 12 Jan 2023 11:37:18 +0000 (19:37 +0800)
committerWayne Zuo <wdvxdr@golangcn.org>
Thu, 19 Jan 2023 23:30:35 +0000 (23:30 +0000)
commit5454834f011c019ca32d844d26d469cd47f407ad
treed00df83ad72e76c50d701181b6204c457c7cecef
parent45dc81d8565adb7d0a62502d039f4930e73d75e0
cmd/internal/obj/riscv: add check for invalid shift amount input

Current RISCV64 assembler do not check the invalid shift amount. This CL
adds the check to avoid generating invalid instructions.

Fixes #57755

Change-Id: If33877605e161baefd98c50db1f71641ca057507
Reviewed-on: https://go-review.googlesource.com/c/go/+/461755
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org>
src/cmd/asm/internal/asm/testdata/riscv64error.s
src/cmd/internal/obj/riscv/obj.go