diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-12-29 22:06:19 -0500 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-12-30 08:21:51 -0500 |
commit | 2d2ee338f3427d39d9977c77b09e5d335b6e362b (patch) | |
tree | 99c0950886ea1bdcf58e82e5de03544f2b5e7661 | |
parent | d5fc3fa4dbf2d6decb6c2582eed6fd2d8003c70c (diff) | |
download | ruby-2d2ee338f3427d39d9977c77b09e5d335b6e362b.tar.gz |
YJIT: Avoid pointer size assumption with intptr_t
Cast to `void *` first to use the definition of `intptr_t`.
-rw-r--r-- | yjit_iface.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/yjit_iface.c b/yjit_iface.c index 339c5cd455..bd0d25b7d7 100644 --- a/yjit_iface.c +++ b/yjit_iface.c @@ -1180,8 +1180,7 @@ rb_yjit_call_threshold(void) 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 |