summaryrefslogtreecommitdiff
path: root/stm/main.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-08 14:08:14 +0000
committerDamien George <damien.p.george@gmail.com>2014-04-08 14:08:14 +0000
commit26cf55ae05658c8a47719d46d48df8c9751108b5 (patch)
treebe29a2ba6c82b486b21e6a7efb98f22eb44645af /stm/main.c
parent094ebef259e86dfc0f1f3c1b493d81e5e8b1b6c4 (diff)
Add a check for NULL nlr_top in nlr_jump.
If no nlr_buf has been pushed, and an nlr_jump is called, then control is transferred to nlr_jump_fail (which should bail out with a fatal error).
Diffstat (limited to 'stm/main.c')
-rw-r--r--stm/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stm/main.c b/stm/main.c
index a11a813d2..636f90021 100644
--- a/stm/main.c
+++ b/stm/main.c
@@ -79,6 +79,11 @@ void __fatal_error(const char *msg) {
}
}
+void nlr_jump_fail(void *val) {
+ printf("FATAL: uncaught exception %p\n", val);
+ __fatal_error("");
+}
+
STATIC mp_obj_t pyb_config_source_dir = MP_OBJ_NULL;
STATIC mp_obj_t pyb_config_main = MP_OBJ_NULL;