summaryrefslogtreecommitdiff
path: root/ractor.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-03-19 21:57:22 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-03-19 21:57:22 +0900
commitbcd0aa896fe84610cef8dc873239738001283538 (patch)
tree143be4c2fb70e618b1a362bd779e6fff202a91de /ractor.c
parente7342e76dfd26237c604e42f9a59a1eaa578c94e (diff)
downloadruby-bcd0aa896fe84610cef8dc873239738001283538.tar.gz
Fix -Wclobbered warning from gcc 12
A variable modified in `EXEC_TAG` block should be `volatile`. ``` ractor.c: In function 'ractor_try_yield': ractor.c:1251:97: warning: argument 'obj' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered] 1251 | ractor_try_yield(rb_execution_context_t *ec, rb_ractor_t *cr, struct rb_ractor_queue *ts, VALUE obj, VALUE move, bool exc, bool is_will) | ~~~~~~^~~ ```
Diffstat (limited to 'ractor.c')
-rw-r--r--ractor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ractor.c b/ractor.c
index 8c367e17cb..dbaa5aab9a 100644
--- a/ractor.c
+++ b/ractor.c
@@ -887,7 +887,7 @@ static VALUE ractor_move(VALUE obj); // in this file
static VALUE ractor_copy(VALUE obj); // in this file
static void
-ractor_basket_prepare_contents(VALUE obj, VALUE move, VALUE *pobj, enum rb_ractor_basket_type *ptype)
+ractor_basket_prepare_contents(VALUE obj, VALUE move, volatile VALUE *pobj, enum rb_ractor_basket_type *ptype)
{
VALUE v;
enum rb_ractor_basket_type type;
@@ -1248,7 +1248,7 @@ ractor_deq_take_basket(rb_ractor_t *cr, struct rb_ractor_queue *rs, struct rb_ra
}
static bool
-ractor_try_yield(rb_execution_context_t *ec, rb_ractor_t *cr, struct rb_ractor_queue *ts, VALUE obj, VALUE move, bool exc, bool is_will)
+ractor_try_yield(rb_execution_context_t *ec, rb_ractor_t *cr, struct rb_ractor_queue *ts, volatile VALUE obj, VALUE move, bool exc, bool is_will)
{
ASSERT_ractor_unlocking(cr);