summaryrefslogtreecommitdiff
path: root/ractor.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-12-27 11:21:46 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-03-15 13:59:11 +0900
commitce47ee00ae295b31dc023afb935a60ecc39a1f4b (patch)
treeaae50ba7487dba8f10c2ed7d473db0f9deb7aa39 /ractor.c
parent04a2550928c3e0122e976fcf87c56f59b8a071ff (diff)
downloadruby-ce47ee00ae295b31dc023afb935a60ecc39a1f4b.tar.gz
Fix indirect counter increment
`*pcnt++` just dereferences `pcnt` then increments the local variable, but has no side effect.
Diffstat (limited to 'ractor.c')
-rw-r--r--ractor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ractor.c b/ractor.c
index c18219e683..8c367e17cb 100644
--- a/ractor.c
+++ b/ractor.c
@@ -3127,7 +3127,7 @@ obj_refer_only_shareables_p_i(VALUE obj, void *ptr)
int *pcnt = (int *)ptr;
if (!rb_ractor_shareable_p(obj)) {
- *pcnt++;
+ ++*pcnt;
}
}