diff --git a/eval.c b/eval.c index 40beac2449..b890c6aa22 100644 --- a/eval.c +++ b/eval.c @@ -42,7 +42,7 @@ NORETURN(static void rb_raise_jump(VALUE, VALUE)); void rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec); void rb_ec_clear_all_trace_func(const rb_execution_context_t *ec); -static int rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex); +static int rb_ec_cleanup(rb_execution_context_t *ec, int ex); static int rb_ec_exec_node(rb_execution_context_t *ec, void *n); VALUE rb_eLocalJumpError; @@ -210,13 +210,13 @@ ruby_finalize(void) * @note This function does not raise any exception. */ int -ruby_cleanup(volatile int ex) +ruby_cleanup(int ex) { return rb_ec_cleanup(GET_EC(), ex); } static int -rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex) +rb_ec_cleanup(rb_execution_context_t *ec, int ex0) { int state; volatile VALUE errs[2] = { Qundef, Qundef }; @@ -225,6 +225,7 @@ rb_ec_cleanup(rb_execution_context_t *ec, volatile int ex) rb_thread_t *const volatile th0 = th; volatile int sysex = EXIT_SUCCESS; volatile int step = 0; + volatile int ex = ex0; rb_threadptr_interrupt(th); rb_threadptr_check_signal(th); diff --git a/include/ruby/internal/fl_type.h b/include/ruby/internal/fl_type.h index 1d570c4743..1906133f9d 100644 --- a/include/ruby/internal/fl_type.h +++ b/include/ruby/internal/fl_type.h @@ -238,7 +238,7 @@ enum { # pragma deprecated(RUBY_FL_DUPPED) #endif - = RUBY_T_MASK | RUBY_FL_EXIVAR + = (int)RUBY_T_MASK | (int)RUBY_FL_EXIVAR }; #undef RBIMPL_HAVE_ENUM_ATTRIBUTE diff --git a/include/ruby/internal/interpreter.h b/include/ruby/internal/interpreter.h index 29dee60aab..12e7486e15 100644 --- a/include/ruby/internal/interpreter.h +++ b/include/ruby/internal/interpreter.h @@ -64,7 +64,7 @@ void ruby_show_copyright(void); void ruby_init_stack(volatile VALUE*); int ruby_setup(void); -int ruby_cleanup(volatile int); +int ruby_cleanup(int); void ruby_finalize(void);