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

ruby-changes:51536

From: normal <ko1@a...>
Date: Mon, 25 Jun 2018 11:52:40 +0900 (JST)
Subject: [ruby-changes:51536] normal:r63746 (trunk): mjit.c: avoid signed pointer comparisons (fix for 32-bit)

normal	2018-06-25 11:52:34 +0900 (Mon, 25 Jun 2018)

  New Revision: 63746

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63746

  Log:
    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.

  Modified files:
    trunk/mjit.c
Index: mjit.c
===================================================================
--- mjit.c	(revision 63745)
+++ mjit.c	(revision 63746)
@@ -946,7 +946,7 @@ convert_unit_to_func(struct rb_mjit_unit https://github.com/ruby/ruby/blob/trunk/mjit.c#L946
 #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 https://github.com/ruby/ruby/blob/trunk/mjit.c#L1101
     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;

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

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