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

ruby-changes:38462

From: nagachika <ko1@a...>
Date: Wed, 20 May 2015 01:49:14 +0900 (JST)
Subject: [ruby-changes:38462] nagachika:r50543 (ruby_2_2): merge revision(s) 50541, 50542: [Backport #11159]

nagachika	2015-05-20 01:48:49 +0900 (Wed, 20 May 2015)

  New Revision: 50543

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

  Log:
    merge revision(s) 50541,50542: [Backport #11159]
    
    * iseq.c (rb_iseq_compile_with_option): check srouce type, must be
      an IO or a String.  [ruby-core:69219] [Bug #11159]
    
    * iseq.c (rb_iseq_compile_with_option): check source type, must be

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/iseq.c
    branches/ruby_2_2/test/ruby/test_iseq.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 50542)
+++ ruby_2_2/ChangeLog	(revision 50543)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Wed May 20 01:47:23 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* iseq.c (rb_iseq_compile_with_option): check source type, must be
+	  an IO or a String.  [ruby-core:69219] [Bug #11159]
+
 Fri May 15 05:01:25 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* symbol.c (Init_sym): make dsym_fstrs a hash compared by identity
Index: ruby_2_2/iseq.c
===================================================================
--- ruby_2_2/iseq.c	(revision 50542)
+++ ruby_2_2/iseq.c	(revision 50543)
@@ -596,6 +596,7 @@ rb_iseq_compile_with_option(VALUE src, V https://github.com/ruby/ruby/blob/trunk/ruby_2_2/iseq.c#L596
 	if (RB_TYPE_P((src), T_FILE))
 	    node = rb_parser_compile_file_path(parser, file, src, ln);
 	else {
+	    StringValue(src);
 	    node = rb_parser_compile_string_path(parser, file, src, ln);
 
 	    if (!node) {
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 50542)
+++ ruby_2_2/version.h	(revision 50543)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.3"
-#define RUBY_RELEASE_DATE "2015-05-15"
-#define RUBY_PATCHLEVEL 102
+#define RUBY_RELEASE_DATE "2015-05-20"
+#define RUBY_PATCHLEVEL 103
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 5
-#define RUBY_RELEASE_DAY 15
+#define RUBY_RELEASE_DAY 20
 
 #include "ruby/version.h"
 
Index: ruby_2_2/test/ruby/test_iseq.rb
===================================================================
--- ruby_2_2/test/ruby/test_iseq.rb	(revision 50542)
+++ ruby_2_2/test/ruby/test_iseq.rb	(revision 50543)
@@ -134,4 +134,11 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_iseq.rb#L134
       assert(!op.to_s.match(/^opt_/), "#{op}")
     }
   end
+
+  def test_invalid_source
+    bug11159 = '[ruby-core:69219] [Bug #11159]'
+    assert_raise(TypeError, bug11159) {ISeq.compile(nil)}
+    assert_raise(TypeError, bug11159) {ISeq.compile(:foo)}
+    assert_raise(TypeError, bug11159) {ISeq.compile(1)}
+  end
 end

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r50541-50542


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

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