ruby-changes:71841
From: Nobuyoshi <ko1@a...>
Date: Tue, 17 May 2022 13:56:50 +0900 (JST)
Subject: [ruby-changes:71841] 8a907da0f6 (master): Suppress an unused-but-set-variable warning [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=8a907da0f6 From 8a907da0f69d66aaedad8518e69cd1160b693840 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 17 May 2022 12:47:01 +0900 Subject: Suppress an unused-but-set-variable warning [ci skip] --- variable.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/variable.c b/variable.c index ae482dfabe..c56217f360 100644 --- a/variable.c +++ b/variable.c @@ -2373,7 +2373,7 @@ autoload_delete(VALUE mod, ID id) https://github.com/ruby/ruby/blob/trunk/variable.c#L2373 /* Qfalse can indicate already deleted */ if (load != Qfalse) { ele = get_autoload_data((VALUE)load, &ac); - VM_ASSERT(ele); + if (!ele) VM_ASSERT(ele); /* * we must delete here to avoid "already initialized" warnings * with parallel autoload. Using list_del_init here so list_del @@ -2390,7 +2390,8 @@ autoload_delete(VALUE mod, ID id) https://github.com/ruby/ruby/blob/trunk/variable.c#L2390 } static int -autoload_by_someone_else(struct autoload_data *ele) { +autoload_by_someone_else(struct autoload_data *ele) +{ return ele->mutex != Qnil && !rb_mutex_owned_p(ele->mutex); } @@ -2451,7 +2452,8 @@ rb_autoloading_value(VALUE mod, ID id, VALUE* value, rb_const_flag_t *flag) https://github.com/ruby/ruby/blob/trunk/variable.c#L2452 } static int -autoload_by_current(struct autoload_data *ele) { +autoload_by_current(struct autoload_data *ele) +{ return ele->mutex != Qnil && rb_mutex_owned_p(ele->mutex); } -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/