summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/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 /stmhal/main.c
parent094ebef259e86dfc0f1f3c1b493d81e5e8b1b6c4 (diff)
downloadmicropython-26cf55ae05658c8a47719d46d48df8c9751108b5.tar.gz
micropython-26cf55ae05658c8a47719d46d48df8c9751108b5.zip
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 'stmhal/main.c')
-rw-r--r--stmhal/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stmhal/main.c b/stmhal/main.c
index 897271d14a..e5ba67dc1d 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -73,6 +73,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;
STATIC mp_obj_t pyb_config_usb_mode = MP_OBJ_NULL;