]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/obj/arm64: fix illegal 4-operand instructions accepted arm64 bug
authorfanzha02 <fannie.zhang@arm.com>
Wed, 25 Apr 2018 09:18:45 +0000 (09:18 +0000)
committerCherry Zhang <cherryyz@google.com>
Mon, 7 May 2018 15:12:35 +0000 (15:12 +0000)
commit9d72e8c686a6e446fbf39d5b6c9cec49f0713282
tree07dac3e6537e4c7be2bf62d6c6864dcaff858ff8
parent7b7a854c041fc15ca11bf760617f11dc31aaa519
cmd/internal/obj/arm64: fix illegal 4-operand instructions accepted arm64 bug

Current assmbler accepts MUL* related instructions with 4 operands,
such as instruction "MUL R1, R2, R3, R4", which is illegal.

The fix adds an actual field informantion to Optab, which has value
of C_NONE, C_REG, etc, so assembler can use p.From3Type for checking
in oplook.

Add test cases.

Fixes #25059

Change-Id: I0656319383c460696b392197bf5960b987f8fc97
Reviewed-on: https://go-review.googlesource.com/109295
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
src/cmd/asm/internal/asm/testdata/arm64.s
src/cmd/asm/internal/asm/testdata/arm64error.s
src/cmd/internal/obj/arm64/asm7.go