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).
This commit is contained in:
5
py/nlr.h
5
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)
|
||||
|
||||
Reference in New Issue
Block a user