Stack overflows now jump to the outermost toplevel.

This commit is contained in:
Juan Jose Garcia Ripoll 2009-09-25 17:45:34 +02:00
parent 5f2e473d36
commit c36eb22e73
4 changed files with 15 additions and 4 deletions

View file

@ -536,6 +536,9 @@ cl_boot(int argc, char **argv)
#endif
GC_enable();
/* Create tag to jump to when aborting */
ECL_SET(env, @'si::*quit-tag*', @'si::*quit-tag*');
/*
* Initialize default pathnames
*/

View file

@ -1835,5 +1835,7 @@ cl_symbols[] = {
{EXT_ "WITH-LOCAL-INTERRUPTS", MP_CONSTANT, NULL, -1, OBJNULL},
{EXT_ "ALLOW-WITH-INTERRUPTS", MP_CONSTANT, NULL, -1, OBJNULL},
{SYS_ "*QUIT-TAG*", SI_SPECIAL, NULL, -1, OBJNULL},
/* Tag for end of list */
{NULL, CL_ORDINARY, NULL, -1, OBJNULL}};

View file

@ -254,8 +254,16 @@ jump_to_sigsegv_handler(cl_env_ptr the_env)
* frame, which is equivalent to quitting, and wait for
* someone to intercept this jump.
*/
ecl_frame_ptr destination = ecl_process_env()->frs_org;
the_env->nvalues = 0;
ecl_frame_ptr destination;
cl_object tag = SYM_VAL(@'si::*quit-tag*');
the_env->nvalues = 0;
if (tag) {
destination = ecl_frs_sch(SYM_VAL(@'si::*quit-tag*'));
if (destination) {
ecl_unwind(the_env, destination);
}
}
destination = ecl_process_env()->frs_org;
ecl_unwind(the_env, destination);
}

View file

@ -4328,5 +4328,3 @@ void GC_print_address_map(void)
}
#endif