Skip to content

Commit 70f8f7c

Browse files
fd00nobu
authored andcommitted
Fix warning on cygwin
1 parent 966fcb7 commit 70f8f7c

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

thread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,8 +1889,8 @@ rb_thread_mn_schedulable(VALUE thval)
18891889
VALUE
18901890
rb_thread_io_blocking_call(struct rb_io* io, rb_blocking_function_t *func, void *data1, int events)
18911891
{
1892-
rb_execution_context_t * ec = GET_EC();
1893-
rb_thread_t *th = rb_ec_thread_ptr(ec);
1892+
rb_execution_context_t * volatile ec = GET_EC();
1893+
rb_thread_t * volatile th = rb_ec_thread_ptr(ec);
18941894

18951895
RUBY_DEBUG_LOG("th:%u fd:%d ev:%d", rb_th_serial(th), io->fd, events);
18961896

vm_core.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,9 +2002,9 @@ rb_current_execution_context(bool expect_ec)
20022002
{
20032003
#ifdef RB_THREAD_LOCAL_SPECIFIER
20042004
#if defined(__arm64__) || defined(__aarch64__)
2005-
rb_execution_context_t *ec = rb_current_ec();
2005+
rb_execution_context_t * volatile ec = rb_current_ec();
20062006
#else
2007-
rb_execution_context_t *ec = ruby_current_ec;
2007+
rb_execution_context_t * volatile ec = ruby_current_ec;
20082008
#endif
20092009

20102010
/* On the shared objects, `__tls_get_addr()` is used to access the TLS
@@ -2021,7 +2021,7 @@ rb_current_execution_context(bool expect_ec)
20212021
*/
20222022
VM_ASSERT(ec == rb_current_ec_noinline());
20232023
#else
2024-
rb_execution_context_t *ec = native_tls_get(ruby_current_ec_key);
2024+
rb_execution_context_t * volatile ec = native_tls_get(ruby_current_ec_key);
20252025
#endif
20262026
VM_ASSERT(!expect_ec || ec != NULL);
20272027
return ec;

0 commit comments

Comments
 (0)