summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Fujimura (fd0) <[email protected]>2025-05-23 20:09:22 +0900
committerNobuyoshi Nakada <[email protected]>2025-05-23 20:49:19 +0900
commit70f8f7c4b11da8e237dc312a76ac49ebe0b66333 (patch)
tree939f07d87bd6c7058a716482ad18f2825ef0acfd
parent966fcb77e48328baf28c1d042d8da25ba181f262 (diff)
Fix warning on cygwin
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13425
-rw-r--r--thread.c4
-rw-r--r--vm_core.h6
2 files changed, 5 insertions, 5 deletions
diff --git a/thread.c b/thread.c
index d900c84f6d..5673b68ebb 100644
--- a/thread.c
+++ b/thread.c
@@ -1889,8 +1889,8 @@ rb_thread_mn_schedulable(VALUE thval)
VALUE
rb_thread_io_blocking_call(struct rb_io* io, rb_blocking_function_t *func, void *data1, int events)
{
- rb_execution_context_t * ec = GET_EC();
- rb_thread_t *th = rb_ec_thread_ptr(ec);
+ rb_execution_context_t * volatile ec = GET_EC();
+ rb_thread_t * volatile th = rb_ec_thread_ptr(ec);
RUBY_DEBUG_LOG("th:%u fd:%d ev:%d", rb_th_serial(th), io->fd, events);
diff --git a/vm_core.h b/vm_core.h
index d6afd585d2..5671a5982a 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -2002,9 +2002,9 @@ rb_current_execution_context(bool expect_ec)
{
#ifdef RB_THREAD_LOCAL_SPECIFIER
#if defined(__arm64__) || defined(__aarch64__)
- rb_execution_context_t *ec = rb_current_ec();
+ rb_execution_context_t * volatile ec = rb_current_ec();
#else
- rb_execution_context_t *ec = ruby_current_ec;
+ rb_execution_context_t * volatile ec = ruby_current_ec;
#endif
/* On the shared objects, `__tls_get_addr()` is used to access the TLS
@@ -2021,7 +2021,7 @@ rb_current_execution_context(bool expect_ec)
*/
VM_ASSERT(ec == rb_current_ec_noinline());
#else
- rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
+ rb_execution_context_t * volatile ec = native_tls_get(ruby_current_ec_key);
#endif
VM_ASSERT(!expect_ec || ec != NULL);
return ec;