diff --git a/soc/runtime/exceptions.c b/soc/runtime/exceptions.c index d6c2e9d10..edf54c95a 100644 --- a/soc/runtime/exceptions.c +++ b/soc/runtime/exceptions.c @@ -30,6 +30,9 @@ int exception_getid(void) void exception_raise(int id) { - stored_id = id; - exception_longjmp(exception_contexts[--ec_top].jb); + if(ec_top > 0) { + stored_id = id; + exception_longjmp(exception_contexts[--ec_top].jb); + } else + corecom_log("WARNING: uncaught exception, ID=%d\n", id); }