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:
Damien George
2014-04-08 14:08:14 +00:00
parent 094ebef259
commit 26cf55ae05
8 changed files with 53 additions and 16 deletions

View File

@@ -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);
}