From faba0ee1c1464aecb10cdae7ea41fe8982fc0a2f Mon Sep 17 00:00:00 2001 From: normal Date: Mon, 25 Jun 2018 02:52:34 +0000 Subject: mjit.c: avoid signed pointer comparisons (fix for 32-bit) ptrdiff_t is a signed type, use uintptr_t instead for unsigned comparisons. This is needed to allow MJIT tests to pass on 32-bit x86 GNU/Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- mjit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mjit.c b/mjit.c index b207986c2b..f1e442f4f5 100644 --- a/mjit.c +++ b/mjit.c @@ -946,7 +946,7 @@ convert_unit_to_func(struct rb_mjit_unit *unit) #endif } - if ((ptrdiff_t)func > (ptrdiff_t)LAST_JIT_ISEQ_FUNC) { + if ((uintptr_t)func > (uintptr_t)LAST_JIT_ISEQ_FUNC) { struct rb_mjit_unit_node *node = create_list_node(unit); CRITICAL_SECTION_START(3, "end of jit"); add_to_list(node, &active_units); @@ -1101,7 +1101,7 @@ mark_ec_units(rb_execution_context_t *ec) const rb_control_frame_t *cfp; rb_control_frame_t *last_cfp = ec->cfp; const rb_control_frame_t *end_marker_cfp; - ptrdiff_t i, size; + uintptr_t i, size; if (ec->vm_stack == NULL) return; -- cgit v1.2.3