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

ruby-changes:50960

From: nobu <ko1@a...>
Date: Mon, 16 Apr 2018 21:46:14 +0900 (JST)
Subject: [ruby-changes:50960] nobu:r63167 (trunk): compile.c: align range

nobu	2018-04-16 21:46:08 +0900 (Mon, 16 Apr 2018)

  New Revision: 63167

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

  Log:
    compile.c: align range
    
    * compile.c (ibf_dump_object_struct): align range elements.
      [ruby-core:86548] [Bug #14689]

  Modified files:
    trunk/compile.c
    trunk/test/ruby/test_iseq.rb
Index: test/ruby/test_iseq.rb
===================================================================
--- test/ruby/test_iseq.rb	(revision 63166)
+++ test/ruby/test_iseq.rb	(revision 63167)
@@ -423,6 +423,7 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L423
 
   def test_to_binary_with_objects
     assert_iseq_to_binary("[]"+100.times.map{|i|"<</#{i}/"}.join)
+    assert_iseq_to_binary("@x ||= (1..2)")
   end
 
   def test_to_binary_line_info
Index: compile.c
===================================================================
--- compile.c	(revision 63166)
+++ compile.c	(revision 63167)
@@ -9259,6 +9259,7 @@ ibf_dump_object_struct(struct ibf_dump * https://github.com/ruby/ruby/blob/trunk/compile.c#L9259
 	range.beg = (long)ibf_dump_object(dump, beg);
 	range.end = (long)ibf_dump_object(dump, end);
 
+	IBF_W_ALIGN(struct ibf_object_struct_range);
 	IBF_WV(range);
     }
     else {
@@ -9425,7 +9426,7 @@ ibf_dump_object_object(struct ibf_dump * https://github.com/ruby/ruby/blob/trunk/compile.c#L9426
     IBF_ZERO(obj_header);
     obj_header.type = TYPE(obj);
 
-    ibf_dump_align(dump, sizeof(ibf_offset_t));
+    IBF_W_ALIGN(ibf_offset_t);
     current_offset = ibf_dump_pos(dump);
 
     if (SPECIAL_CONST_P(obj)) {

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

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