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

ruby-changes:54612

From: naruse <ko1@a...>
Date: Tue, 15 Jan 2019 17:56:00 +0900 (JST)
Subject: [ruby-changes:54612] naruse:r66827 (ruby_2_6): merge revision(s) 66736: [Backport #15511]

naruse	2019-01-15 17:55:56 +0900 (Tue, 15 Jan 2019)

  New Revision: 66827

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

  Log:
    merge revision(s) 66736: [Backport #15511]
    
    ast.c: argument must be a string
    
    [ruby-core:90904] [Bug #15511]

  Modified directories:
    branches/ruby_2_6/
  Modified files:
    branches/ruby_2_6/ast.c
    branches/ruby_2_6/test/ruby/test_ast.rb
    branches/ruby_2_6/version.h
Index: ruby_2_6/ast.c
===================================================================
--- ruby_2_6/ast.c	(revision 66826)
+++ ruby_2_6/ast.c	(revision 66827)
@@ -96,7 +96,7 @@ rb_ast_parse_str(VALUE str) https://github.com/ruby/ruby/blob/trunk/ruby_2_6/ast.c#L96
 {
     rb_ast_t *ast = 0;
 
-    str = rb_check_string_type(str);
+    StringValue(str);
     ast = rb_parser_compile_string_path(ast_parse_new(), Qnil, str, 1);
     return ast_parse_done(ast);
 }
Index: ruby_2_6/version.h
===================================================================
--- ruby_2_6/version.h	(revision 66826)
+++ ruby_2_6/version.h	(revision 66827)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_6/version.h#L1
 #define RUBY_VERSION "2.6.0"
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 11
+#define RUBY_PATCHLEVEL 12
 
 #define RUBY_RELEASE_YEAR 2019
 #define RUBY_RELEASE_MONTH 1
Index: ruby_2_6/test/ruby/test_ast.rb
===================================================================
--- ruby_2_6/test/ruby/test_ast.rb	(revision 66826)
+++ ruby_2_6/test/ruby/test_ast.rb	(revision 66827)
@@ -134,6 +134,14 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_6/test/ruby/test_ast.rb#L134
     assert_raise(TypeError) {RubyVM::AbstractSyntaxTree::Node.allocate}
   end
 
+  def test_parse_argument_error
+    assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(0)}
+    assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(nil)}
+    assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(false)}
+    assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(true)}
+    assert_raise(TypeError) {RubyVM::AbstractSyntaxTree.parse(:foo)}
+  end
+
   def test_column_with_long_heredoc_identifier
     term = "A"*257
     ast = RubyVM::AbstractSyntaxTree.parse("<<-#{term}\n""ddddddd\n#{term}\n")
Index: ruby_2_6
===================================================================
--- ruby_2_6	(revision 66826)
+++ ruby_2_6	(revision 66827)

Property changes on: ruby_2_6
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /trunk:r66736

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

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