diff --git a/src/c/error.d b/src/c/error.d index 1b3bc8e2c..97c5a06b9 100644 --- a/src/c/error.d +++ b/src/c/error.d @@ -91,8 +91,12 @@ ecl_unrecoverable_error(cl_env_ptr the_env, const char *message) ecl_unwind(the_env, destination); } } - destination = ecl_process_env()->frs_org; - ecl_unwind(the_env, destination); + if (the_env->frs_org <= the_env->frs_top) { + destination = ecl_process_env()->frs_org; + ecl_unwind(the_env, destination); + } else { + ecl_internal_error("\n;;;\n;;; No frame to jump to\n;;; Aborting ECL\n;;;"); + } } /*****************************************************************************/