From 26cf55ae05658c8a47719d46d48df8c9751108b5 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 8 Apr 2014 14:08:14 +0000 Subject: 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). --- stm/main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'stm/main.c') 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; -- cgit v1.2.3