Skip to contentSkip to conversation

RISC-V: Fix missing break statement in disassembler

PATCH In review Michael Clark 3 participants 3 messages Apr 29, 2018 – May 1, 2018 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RISC-V: Fix missing break statement in disassembler

This fixes an issue when disassembling rv128 c.sqsp, where the code erroneously fell through to c.swsp.

Cc Palmer Dabbelt <[email protected]>
Cc Sagar Karandikar <[email protected]>
Cc Bastian Koppelmann <[email protected]>
Cc Peter Maydell <[email protected]>
---
 disas/riscv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
disas/riscv.c +2 -1
index 74ad16eacdd3..ea19f6fbe2b1 100644
@@ -1470,8 +1470,9 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa)
             if (isa == rv128) {
                 op = rv_op_c_sqsp;
             } else {
-                op = rv_op_c_fsdsp; break;
+                op = rv_op_c_fsdsp;
             }
+            break;
         case 6: op = rv_op_c_swsp; break;
         case 7:
             if (isa == rv32) {
Signature · 1 line
2.7.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Michael Clark

This fixes an issue when disassembling rv128 c.sqsp, where the code erroneously fell through to c.swsp.

Cc Palmer Dabbelt <[email protected]>
Cc Sagar Karandikar <[email protected]>
Cc Bastian Koppelmann <[email protected]>
Cc Peter Maydell <[email protected]>
---
 disas/riscv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

r~

Reviewed-by on v1 1/1
#2 lore raw
In reply to Michael Clark
Quoted 8 lines · Michael Clark

This fixes an issue when disassembling rv128 c.sqsp, where the code erroneously fell through to c.swsp.

Cc Palmer Dabbelt <[email protected]>
Cc Sagar Karandikar <[email protected]>
Cc Bastian Koppelmann <[email protected]>
Cc Peter Maydell <[email protected]>
Quoted 20 lines
---
 disas/riscv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
disas/riscv.c +2 -1
index 74ad16eacdd3..ea19f6fbe2b1 100644
@@ -1470,8 +1470,9 @@ static void decode_inst_opcode(rv_decode *dec, rv_isa isa)
             if (isa == rv128) {
                 op = rv_op_c_sqsp;
             } else {
-                op = rv_op_c_fsdsp; break;
+                op = rv_op_c_fsdsp;
             }
+            break;
         case 6: op = rv_op_c_swsp; break;
         case 7:
             if (isa == rv32) {