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

ruby-changes:53106

From: mame <ko1@a...>
Date: Tue, 23 Oct 2018 21:38:54 +0900 (JST)
Subject: [ruby-changes:53106] mame:r65320 (trunk): addr2line.c: add explicit casts for clang on 32bit environment

mame	2018-10-23 21:38:48 +0900 (Tue, 23 Oct 2018)

  New Revision: 65320

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

  Log:
    addr2line.c: add explicit casts for clang on 32bit environment
    
    Assigning uint64_t to size_t or uintptr_t caused a build error.

  Modified files:
    trunk/addr2line.c
Index: addr2line.c
===================================================================
--- addr2line.c	(revision 65319)
+++ addr2line.c	(revision 65320)
@@ -1104,7 +1104,7 @@ debug_info_reader_read_value(DebugInfoRe https://github.com/ruby/ruby/blob/trunk/addr2line.c#L1104
         /* stroffsetsptr: debug_str_offsets */
         break;
       case DW_FORM_exprloc:
-        v->size = read_uleb128(reader);
+        v->size = (size_t)read_uleb128(reader);
         set_data_value(v, reader->p);
         reader->p += v->size;
         break;
@@ -1350,7 +1350,7 @@ ranges_include(DebugInfoReader *reader, https://github.com/ruby/ruby/blob/trunk/addr2line.c#L1350
             exit(1);
         }
         if (ptr->low_pc <= addr && addr <= ptr->high_pc) {
-            return ptr->low_pc;
+            return (uintptr_t)ptr->low_pc;
         }
     }
     else if (ptr->ranges_set) {
@@ -1372,7 +1372,7 @@ ranges_include(DebugInfoReader *reader, https://github.com/ruby/ruby/blob/trunk/addr2line.c#L1372
     }
     else if (ptr->low_pc_set) {
         if (ptr->low_pc == addr) {
-            return ptr->low_pc;
+            return (uintptr_t)ptr->low_pc;
         }
     }
     return false;

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

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