@@ -1401,7 +1401,7 @@ CL_LAMBDA(&optional (exit-value 0));
14011401CL_DECLARE ();
14021402CL_DOCSTRING (R"dx( exit)dx" );
14031403DOCGROUP (clasp);
1404- CL_DEFUN void core__exit (int exitValue) {
1404+ [[noreturn]] CL_DEFUN void core__exit (int exitValue) {
14051405#ifdef CLASP_APPLE_SILICON
14061406 exit (exitValue);
14071407#else
@@ -1416,7 +1416,7 @@ CL_DEFUN void core__exit(int exitValue) {
14161416 }
14171417 VirtualMachine& vm = my_thread->_VM ;
14181418 vm.shutdown ();
1419- throw ( ExitProgramException ( exitValue) );
1419+ exit ( exitValue);
14201420#endif
14211421};
14221422
@@ -2211,24 +2211,23 @@ void Lisp::dump_apropos(const char* part) const {
22112211
22122212bool Lisp::load (int & exitCode) {
22132213 MultipleValues& mvn = core::lisp_multipleValues ();
2214- try {
2215- switch (global_options->_StartupType ) {
2216- case cloInitLisp: {
2217- Pathname_sp initPathname = cl__pathname (SimpleBaseString_O::make (globals_->_InitFileName ));
2218- if (!global_options->_SilentStartup ) {
2219- printf (" Loading image %s\n " , _rep_ (initPathname).c_str ());
2220- }
2221- T_mv result = core__load_no_package_set (initPathname);
2222- if (result.nilp ()) {
2223- T_sp err = mvn.second (result.number_of_values ());
2224- printf (" Could not load %s error: %s\n " , _rep_ (initPathname).c_str (), _rep_ (err).c_str ());
2225- exitCode = 1 ;
2226- return false ;
2227- }
2228- } break ;
2229- case cloBaseImage:
2230- case cloExtensionImage:
2231- case cloImageFile:
2214+ switch (global_options->_StartupType ) {
2215+ case cloInitLisp: {
2216+ Pathname_sp initPathname = cl__pathname (SimpleBaseString_O::make (globals_->_InitFileName ));
2217+ if (!global_options->_SilentStartup ) {
2218+ printf (" Loading image %s\n " , _rep_ (initPathname).c_str ());
2219+ }
2220+ T_mv result = core__load_no_package_set (initPathname);
2221+ if (result.nilp ()) {
2222+ T_sp err = mvn.second (result.number_of_values ());
2223+ printf (" Could not load %s error: %s\n " , _rep_ (initPathname).c_str (), _rep_ (err).c_str ());
2224+ exitCode = 1 ;
2225+ return false ;
2226+ }
2227+ } break ;
2228+ case cloBaseImage:
2229+ case cloExtensionImage:
2230+ case cloImageFile:
22322231 if (startup_functions_are_waiting ()) {
22332232 startup_functions_invoke (NULL );
22342233 } else {
@@ -2251,36 +2250,21 @@ bool Lisp::load(int& exitCode) {
22512250 }
22522251 }
22532252 break ;
2254- default :
2253+ default :
22552254 break ;
2256- }
2257- } catch (core::ExitProgramException& ee) {
2258- exitCode = ee.getExitResult ();
2259- return false ;
22602255 }
22612256 return true ;
22622257};
22632258
22642259int Lisp::run () {
2265- int exitCode;
2266- try {
2267- if (ext::_sym_STARtoplevel_hookSTAR->symbolValue ().notnilp ()) {
2268- core::T_sp fn = ext::_sym_STARtoplevel_hookSTAR->symbolValue ();
2269- core::eval::funcall (fn);
2270- } else if (global_options->_Interactive ) {
2271- this ->readEvalPrintInteractive ();
2272- }
2273- exitCode = 0 ;
2274- } catch (core::ExitProgramException& ee) {
2275- exitCode = ee.getExitResult ();
2276- }
2277- if (global_options->_ExportedSymbolsSave ) {
2278- T_sp stream = core::cl__open (core::SimpleBaseString_O::make (global_options->_ExportedSymbolsFilename ), StreamDirection::output);
2279- core::core__mangledSymbols (stream);
2280- cl__close (stream);
2260+ if (ext::_sym_STARtoplevel_hookSTAR->symbolValue ().notnilp ()) {
2261+ core::T_sp fn = ext::_sym_STARtoplevel_hookSTAR->symbolValue ();
2262+ core::eval::funcall (fn);
2263+ } else if (global_options->_Interactive ) {
2264+ this ->readEvalPrintInteractive ();
22812265 }
22822266
2283- return exitCode ;
2267+ return 0 ;
22842268};
22852269
22862270FileScope_mv Lisp::getOrRegisterFileScope (const string& fileName) {
0 commit comments