Skip to content

Commit 58ea1a1

Browse files
wei xiaobradfitz
wei xiao
authored andcommitted
arm/armasm: fix bug of plan9 register list argument
If the register list contains multiple sub-lists, e.g., [R0,R2-R3,R5-R7], current implementation just flushes the last sub-list, i.e., [R5-R7]. The fix flushes previous sub-lists if any. Fixes golang/go#19142 Change-Id: Ic4eaec76e4f654bf0b92b398b71b2050cede3cbb Reviewed-on: https://go-review.googlesource.com/37172 Reviewed-by: Cherry Zhang <[email protected]> Run-TryBot: Cherry Zhang <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent f108ada commit 58ea1a1

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

arm/armasm/plan9x.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ func plan9Arg(inst *Inst, pc uint64, symname func(uint64) (string, uint64), arg
185185
} else {
186186
fmt.Fprintf(&buf, "R%d-R%d", start, end)
187187
}
188+
start = -2
189+
end = -2
188190
}
189191
}
190192
for i := 0; i < 16; i++ {
@@ -195,6 +197,8 @@ func plan9Arg(inst *Inst, pc uint64, symname func(uint64) (string, uint64), arg
195197
}
196198
start = i
197199
end = i
200+
} else {
201+
flush()
198202
}
199203
}
200204
flush()

arm/armasm/testdata/decode.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,3 +304,4 @@ ff818c71| 1 gnu strdvc r8, [ip, pc]
304304
|6b5721d3 1 gnu error: unknown instruction
305305
|76452001 1 gnu error: unknown instruction
306306
|97acd647 1 gnu error: unknown instruction
307+
ed003be9| 1 plan9 LDMDB [R0,R2-R3,R5-R7], R11!

0 commit comments

Comments
 (0)