Skip to content

Commit

Permalink
call julia_init before entering --lisp prompt
Browse files Browse the repository at this point in the history
this fixes a crash when lisp calls julia runtime code that tries to
establish an exception handler. it also allows expanding Base macros
from the lisp prompt, which could be very useful.
  • Loading branch information
JeffBezanson committed Dec 14, 2016
1 parent bfc72b6 commit d72b51f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ui/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,17 @@ int wmain(int argc, wchar_t *argv[], wchar_t *envp[])
}
#endif
libsupport_init();
if (argc >= 2 && strcmp((char*)argv[1],"--lisp") == 0) {
jl_lisp_prompt();
return 0;
int lisp_prompt = (argc >= 2 && strcmp((char*)argv[1],"--lisp") == 0);
if (lisp_prompt) {
memmove(&argv[1], &argv[2], (argc-2)*sizeof(void*));
argc--;
}
jl_parse_opts(&argc, (char***)&argv);
julia_init(jl_options.image_file_specified ? JL_IMAGE_CWD : JL_IMAGE_JULIA_HOME);
if (lisp_prompt) {
jl_lisp_prompt();
return 0;
}
int ret = true_main(argc, (char**)argv);
jl_atexit_hook(ret);
return ret;
Expand Down

0 comments on commit d72b51f

Please sign in to comment.