diff --git a/src/c/main.d b/src/c/main.d index 5d01bf986..2eeab122f 100644 --- a/src/c/main.d +++ b/src/c/main.d @@ -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 */ diff --git a/src/c/symbols_list.h b/src/c/symbols_list.h index 30f7c87f0..1e72d240d 100644 --- a/src/c/symbols_list.h +++ b/src/c/symbols_list.h @@ -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}}; diff --git a/src/c/unixint.d b/src/c/unixint.d index 2670968c4..3338b6428 100644 --- a/src/c/unixint.d +++ b/src/c/unixint.d @@ -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); } diff --git a/src/gc/os_dep.c b/src/gc/os_dep.c index a9a5ae297..bfc517503 100644 --- a/src/gc/os_dep.c +++ b/src/gc/os_dep.c @@ -4328,5 +4328,3 @@ void GC_print_address_map(void) } #endif - -