From 527b478edb86126d2db98d9a0f619cbc83dce1db Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 3 Mar 2015 10:12:26 -0800 Subject: [PATCH] cmd/internal/obj/arm: fix arm build Mishandled the mask for the arm instructions. TBR=rsc Change-Id: Idc596097c0fa61dcacdfb4aca5bc6d0b4fd40eeb Reviewed-on: https://go-review.googlesource.com/6641 Reviewed-by: Rob Pike --- src/cmd/internal/obj/arm/asm5.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go index 10cca251725..980bbebca6d 100644 --- a/src/cmd/internal/obj/arm/asm5.go +++ b/src/cmd/internal/obj/arm/asm5.go @@ -1361,17 +1361,18 @@ func buildop(ctxt *obj.Link) { sort.Sort(ocmp(optab[:n])) for i := 0; i < n; i++ { - r0 := optab[i].as & obj.AMask + r := optab[i].as + r0 := r & obj.AMask oprange[r0].start = optab[i:] - for optab[i].as&obj.AMask == r0 { + for optab[i].as == r { i++ } oprange[r0].stop = optab[i:] i-- - switch r0 { + switch r { default: - ctxt.Diag("unknown op in build: %v", obj.Aconv(int(optab[i].as))) + ctxt.Diag("unknown op in build: %v", obj.Aconv(int(r))) log.Fatalf("bad code") case AADD: