aboutsummaryrefslogtreecommitdiff
path: root/py/nlr.h
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 /py/nlr.h
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 'py/nlr.h')
-rw-r--r--py/nlr.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/nlr.h b/py/nlr.h
index ce62334fd..4e931919d 100644
--- a/py/nlr.h
+++ b/py/nlr.h
@@ -27,6 +27,11 @@ unsigned int nlr_push(nlr_buf_t *);
void nlr_pop(void);
void nlr_jump(void *val) __attribute__((noreturn));
+// This must be implemented by a port. It's called by nlr_jump
+// if no nlr buf has been pushed. It must not return, but rather
+// should bail out with a fatal error.
+void nlr_jump_fail(void *val);
+
// use nlr_raise instead of nlr_jump so that debugging is easier
#ifndef DEBUG
#define nlr_raise(val) nlr_jump(val)