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

ruby-changes:40889

From: nobu <ko1@a...>
Date: Wed, 9 Dec 2015 00:27:07 +0900 (JST)
Subject: [ruby-changes:40889] nobu:r52968 (trunk): compile.c: fix extra_str

nobu	2015-12-09 00:26:58 +0900 (Wed, 09 Dec 2015)

  New Revision: 52968

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

  Log:
    compile.c: fix extra_str
    
    * compile.c (iseq_ibf_load_extra_data): fix offset and
      length of extra_str, which is not NUL-terminated.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 52967)
+++ compile.c	(revision 52968)
@@ -8284,7 +8284,7 @@ iseq_ibf_load_extra_data(VALUE str) https://github.com/ruby/ruby/blob/trunk/compile.c#L8284
     VALUE extra_str;
 
     ibf_load_setup(load, loader_obj, str);
-    extra_str = rb_str_new2(load->buff + load->header->extra_size);
+    extra_str = rb_str_new(load->buff + load->header->size, load->header->extra_size);
     RB_GC_GUARD(loader_obj);
     return extra_str;
 }

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

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