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:
@@ -293,6 +293,7 @@ void pre_process_options(int argc, char **argv) {
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
nlr_jump(0);
|
||||
volatile int stack_dummy;
|
||||
stack_top = (void*)&stack_dummy;
|
||||
|
||||
@@ -447,3 +448,8 @@ int DEBUG_printf(const char *fmt, ...) {
|
||||
va_end(ap);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void nlr_jump_fail(void *val) {
|
||||
printf("FATAL: uncaught NLR %p\n", val);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user