diff options
author | Andrew Waterman <andrew@sifive.com> | 2022-09-22 14:55:00 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2022-10-04 15:40:01 -0700 |
commit | 3e166310b4fab72cbbf73e34de6a0b66ba6155ed (patch) | |
tree | f216fbf95cea96771d10d289d5b4905a2371d725 /riscv | |
parent | 3c9cfac9b1f7f1ddf07816f948c15f88aac27dcf (diff) | |
download | spike-3e166310b4fab72cbbf73e34de6a0b66ba6155ed.zip spike-3e166310b4fab72cbbf73e34de6a0b66ba6155ed.tar.gz spike-3e166310b4fab72cbbf73e34de6a0b66ba6155ed.tar.bz2 |
Rewrite require macro so it can be used as an expression
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/insn_macros.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/riscv/insn_macros.h b/riscv/insn_macros.h index 2fdfced..8ec8f76 100644 --- a/riscv/insn_macros.h +++ b/riscv/insn_macros.h @@ -4,6 +4,6 @@ // These conflict with Boost headers so can't be included from insn_template.h #define P (*p) -#define require(x) do { if (unlikely(!(x))) throw trap_illegal_instruction(insn.bits()); } while (0) +#define require(x) (unlikely(!(x)) ? throw trap_illegal_instruction(insn.bits()) : (void) 0) #endif |