Skip to content

Commit

Permalink
unreachable: include PC in the trap message
Browse files Browse the repository at this point in the history
revisit: i guess this ought to be more generic.
  • Loading branch information
yamt committed Jul 6, 2023
1 parent 22c1bbb commit bd1d5f3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/insn_impl_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
INSN_IMPL(unreachable)
{
if (EXECUTING) {
return trap_with_id(ECTX, TRAP_UNREACHABLE, "unreachable");
LOAD_PC;
struct exec_context *ectx = ECTX;
const struct module *m = ectx->instance->module;
return trap_with_id(ectx, TRAP_UNREACHABLE,
"unreachable at %06" PRIx32,
ptr2pc(m, ORIG_PC - 1));
} else if (VALIDATING) {
mark_unreachable(VCTX);
}
Expand Down

0 comments on commit bd1d5f3

Please sign in to comment.