1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

YJIT: Avoid pointer size assumption with intptr_t

Cast to `void *` first to use the definition of `intptr_t`.
This commit is contained in:
Alan Wu 2021-12-29 22:06:19 -05:00
parent d5fc3fa4db
commit 2d2ee338f3
Notes: git 2021-12-30 22:22:21 +09:00

View file

@ -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