[前][次][番号順一覧][スレッド一覧]

ruby-changes:73641

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Wed, 21 Sep 2022 11:44:28 +0900 (JST)
Subject: [ruby-changes:73641] 406ebb25a0 (master): obj_refer_only_sharables_p_i: need derefernce

https://git.ruby-lang.org/ruby.git/commit/?id=406ebb25a0

From 406ebb25a017dba5b066a42a1c325e57fa644e95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Tue, 13 Sep 2022 15:18:46 +0900
Subject: obj_refer_only_sharables_p_i: need derefernce

Clang says "warning: variable 'pcnt' set but not used" here.  In fact it
doesn't. The intention is clear that we want to increment cnt, not pcnt.
Adding a * mark solves everything.
---
 ractor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ractor.c b/ractor.c
index 0eddc165fa..3bd6c04af0 100644
--- a/ractor.c
+++ b/ractor.c
@@ -2685,7 +2685,7 @@ obj_refer_only_shareables_p_i(VALUE obj, void *ptr) https://github.com/ruby/ruby/blob/trunk/ractor.c#L2685
     int *pcnt = (int *)ptr;
 
     if (!rb_ractor_shareable_p(obj)) {
-        pcnt++;
+        *pcnt++;
     }
 }
 
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]