Browse Source

sim: riscv: Fix crash during instruction decoding

The match_never() function has been removed and thus step_once() crashes
during instruction decoding. Fixed it by checking for null pointer before
invoking function attached to match_func member of riscv_opcode structure
users/ARM/gcs-binutils-gdb-master
Jaydeep Patil 3 years ago
committed by Mike Frysinger
parent
commit
b783d068d9
  1. 2
      sim/riscv/sim-main.c

2
sim/riscv/sim-main.c

@ -1040,7 +1040,7 @@ void step_once (SIM_CPU *cpu)
for (; op->name; op++)
{
/* Does the opcode match? */
if (! op->match_func (op, iw))
if (! op->match_func || ! op->match_func (op, iw))
continue;
/* Is this a pseudo-instruction and may we print it as such? */
if (op->pinfo & INSN_ALIAS)

Loading…
Cancel
Save