Skip to content

Commit 644539b

Browse files
committed
nvic: replace emulator process shutdown with forced crash on Exception Return inconsistency
1 parent a70fd8c commit 644539b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

harness/fuzzware_harness/native/core_peripherals/cortexm_nvic.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,10 +937,13 @@ void ExceptionReturn(uc_engine *uc, uint32_t ret_pc) {
937937

938938
PopStack(uc);
939939

940-
nvic_assert(
941-
(((ret_pc & NVIC_INTERRUPT_ENTRY_LR_THREADMODE_FLAG) != 0) == (nvic.active_irq == NVIC_NONE_ACTIVE)),
942-
"[ExceptionReturn] expected thread mode return to end up with nvic.active_irq == NVIC_NONE_ACTIVE and vice versa."
943-
);
940+
if(((ret_pc & NVIC_INTERRUPT_ENTRY_LR_THREADMODE_FLAG) != 0) != (nvic.active_irq == NVIC_NONE_ACTIVE)) {
941+
if(do_print_exit_info) {
942+
puts("[ExceptionReturn] expected thread mode return to end up with nvic.active_irq == NVIC_NONE_ACTIVE and vice versa.");
943+
fflush(stdout);
944+
}
945+
force_crash(uc, UC_ERR_FETCH_PROT);
946+
}
944947
}
945948

946949
// idea: just hook code for the magic is_exception_ret address range

0 commit comments

Comments
 (0)