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

ruby-changes:70666

From: Alan <ko1@a...>
Date: Thu, 30 Dec 2021 22:22:14 +0900 (JST)
Subject: [ruby-changes:70666] 2d2ee338f3 (master): YJIT: Avoid pointer size assumption with intptr_t

https://git.ruby-lang.org/ruby.git/commit/?id=2d2ee338f3

From 2d2ee338f3427d39d9977c77b09e5d335b6e362b Mon Sep 17 00:00:00 2001
From: Alan Wu <XrXr@u...>
Date: Wed, 29 Dec 2021 22:06:19 -0500
Subject: YJIT: Avoid pointer size assumption with intptr_t

Cast to `void *` first to use the definition of `intptr_t`.
---
 yjit_iface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/yjit_iface.c b/yjit_iface.c
index 339c5cd455a..bd0d25b7d73 100644
--- a/yjit_iface.c
+++ b/yjit_iface.c
@@ -1180,8 +1180,7 @@ rb_yjit_call_threshold(void) https://github.com/ruby/ruby/blob/trunk/yjit_iface.c#L1180
     return rb_yjit_opts.call_threshold;
 }
 
-/* assume sizeof(void*) == sizeof(size_t) */
-# define PTR2NUM(x)   (SSIZET2NUM((ssize_t)(x)))
+# define PTR2NUM(x)   (rb_int2inum((intptr_t)(void *)(x)))
 
 /**
  *  call-seq: block.id -> unique_id
-- 
cgit v1.2.1


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

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