From 67d0f4821ff9ae550425a66202710d82de886384 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 25 Nov 2022 14:20:46 +0900 Subject: [PATCH] [Bug #19145] `volatile` on an argument may not be effective --- eval_error.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eval_error.c b/eval_error.c index 0112dece0d..e02f54e8e6 100644 --- a/eval_error.c +++ b/eval_error.c @@ -333,11 +333,12 @@ rb_error_write(VALUE errinfo, VALUE emesg, VALUE errat, VALUE str, VALUE opt, VA } static void -rb_ec_error_print_detailed(rb_execution_context_t *volatile ec, volatile VALUE errinfo, VALUE str, volatile VALUE emesg) +rb_ec_error_print_detailed(rb_execution_context_t *const ec, const VALUE errinfo, const VALUE str, VALUE emesg0) { volatile uint8_t raised_flag = ec->raised_flag; volatile VALUE errat = Qundef; volatile bool written = false; + volatile VALUE emesg = emesg0; VALUE opt = rb_hash_new(); VALUE highlight = rb_stderr_tty_p() ? Qtrue : Qfalse;