Skip to content

Commit

Permalink
mjit.h: avoid signed pointer comparisons (fix for 32-bit)
Browse files Browse the repository at this point in the history
ptrdiff_t is a signed type, use uintptr_t instead for unsigned
comparisons.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
normal committed Jul 3, 2018
1 parent 1b81242 commit 8d004ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mjit.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ mjit_exec(rb_execution_context_t *ec)
total_calls = ++body->total_calls;

func = body->jit_func;
if (UNLIKELY((ptrdiff_t)func <= (ptrdiff_t)LAST_JIT_ISEQ_FUNC)) {
if (UNLIKELY((uintptr_t)func <= (uintptr_t)LAST_JIT_ISEQ_FUNC)) {
switch ((enum rb_mjit_iseq_func)func) {
case NOT_ADDED_JIT_ISEQ_FUNC:
if (total_calls == mjit_opts.min_calls && mjit_target_iseq_p(body)) {
Expand Down

0 comments on commit 8d004ee

Please sign in to comment.