Browse Source

Merge pull request #1074 from YenHaoChen/master

Fix tval on illegal instruction faults with long illegal instruction
pull/1076/head
Scott Johnson 4 years ago
committed by GitHub
parent
commit
7f2f73609b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      riscv/processor.cc

5
riscv/processor.cc

@ -949,7 +949,10 @@ reg_t processor_t::get_csr(int which, insn_t insn, bool write, bool peek)
reg_t illegal_instruction(processor_t* p, insn_t insn, reg_t pc)
{
throw trap_illegal_instruction(insn.bits());
// The illegal instruction can be longer than ILEN bits, where the tval will
// contain the first ILEN bits of the faulting instruction. We hard-code the
// ILEN to 32 bits since all official instructions have at most 32 bits.
throw trap_illegal_instruction(insn.bits() & 0xffffffffULL);
}
insn_func_t processor_t::decode_insn(insn_t insn)

Loading…
Cancel
Save