]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/riscv: prevent constant loads that do not target registers
authorJoel Sing <joel@sing.id.au>
Wed, 17 Feb 2021 10:03:59 +0000 (21:03 +1100)
committerJoel Sing <joel@sing.id.au>
Tue, 23 Feb 2021 09:15:50 +0000 (09:15 +0000)
commit0398a771d2fb4c4702e31bbb485924198b1b2603
tree739a79e1117f4144d2d49820e0ee1c307905865a
parent6525abddcee2886ca0095decdfe1e97de19d06f2
cmd/internal/obj/riscv: prevent constant loads that do not target registers

Check that the target of a constant load is a register and add test coverage
for this error condition. While here, rename the RISC-V testdata and tests
to be consistent with other platforms.

Change-Id: I7fd0bfcee8cf9df0597d72e65cd74a2d0bfd349a
Reviewed-on: https://go-review.googlesource.com/c/go/+/292895
Trust: Joel Sing <joel@sing.id.au>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/asm/internal/asm/endtoend_test.go
src/cmd/asm/internal/asm/testdata/riscv64.s [moved from src/cmd/asm/internal/asm/testdata/riscvenc.s with 100% similarity]
src/cmd/asm/internal/asm/testdata/riscv64error.s [new file with mode: 0644]
src/cmd/internal/obj/riscv/obj.go