diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-11-18 18:22:12 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-11-20 20:00:40 +0900 |
commit | 701dfe4eb741628213e4d701c13ad6d76904ac4f (patch) | |
tree | 6ab2acd1b798fa2aedd4d473038ca1cbb2302237 /eval.c | |
parent | 12b7b852272c23d8449af507405ac93cedcb6dd6 (diff) |
[Bug #19016] Handle syntax error in main script like other errors
So that `SyntaxError#detailed_message` will be used also in the case
exiting by such syntax error.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6771
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -121,6 +121,7 @@ ruby_options(int argc, char **argv) else { rb_ec_clear_current_thread_trace_func(ec); state = error_handle(ec, state); + ec->errinfo = Qnil; /* just been handled */ iseq = (void *)INT2FIX(state); } EC_POP_TAG(); @@ -317,7 +318,7 @@ ruby_run_node(void *n) rb_execution_context_t *ec = GET_EC(); int status; if (!ruby_executable_node(n, &status)) { - rb_ec_cleanup(ec, 0); + rb_ec_cleanup(ec, (NIL_P(ec->errinfo) ? TAG_NONE : TAG_RAISE)); return status; } ruby_init_stack((void *)&status); |