From 0ea3f6f5927366a1288ede643cc378b79074db78 Mon Sep 17 00:00:00 2001 From: lambert_wu Date: Sat, 4 Jun 2022 10:53:47 +0800 Subject: [PATCH] =?UTF-8?q?remove=20`goto=20quit`=20since=20`goto=20quit`?= =?UTF-8?q?=20will=20return=EF=BC=8Cso=20remove=20it=20avoid=20jump=20twic?= =?UTF-8?q?e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- riscv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/riscv.c b/riscv.c index 5a2e8449..1a046b72 100644 --- a/riscv.c +++ b/riscv.c @@ -1338,7 +1338,7 @@ void rv_step(struct riscv_t *rv, int32_t cycles) #define DISPATCH() \ { \ if (rv->csr_cycle >= cycles_target || rv->halt) \ - goto quit; \ + return; \ /* fetch the next instruction */ \ inst = rv->io.mem_ifetch(rv, rv->PC); \ /* standard uncompressed instruction */ \ @@ -1356,7 +1356,7 @@ void rv_step(struct riscv_t *rv, int32_t cycles) { \ /* dispatch this opcode */ \ if (!op_##instr(rv, inst)) \ - goto quit; \ + return; \ /* increment the cycles csr */ \ rv->csr_cycle++; \ } @@ -1403,9 +1403,6 @@ void rv_step(struct riscv_t *rv, int32_t cycles) #endif TARGET(unimp) -quit: - return; - #undef DISPATCH_RV32C #undef DISPATCH #undef EXEC