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

ruby-changes:35321

From: usa <ko1@a...>
Date: Fri, 5 Sep 2014 13:54:34 +0900 (JST)
Subject: [ruby-changes:35321] usa:r47403 (ruby_2_0_0): merge revision(s) 47098: [Backport #10117]

usa	2014-09-05 13:54:26 +0900 (Fri, 05 Sep 2014)

  New Revision: 47403

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

  Log:
    merge revision(s) 47098: [Backport #10117]
    
    * parse.y (parser_yylex): fix invalid char in eval, should raise
      an syntax error too, as well as directly coded.
      [ruby-core:64243] [Bug #10117]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/parse.y
    branches/ruby_2_0_0/test/ruby/test_parse.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 47402)
+++ ruby_2_0_0/ChangeLog	(revision 47403)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Fri Sep  5 13:53:41 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (parser_yylex): fix invalid char in eval, should raise
+	  an syntax error too, as well as directly coded.
+	  [ruby-core:64243] [Bug #10117]
+
 Fri Sep  5 13:51:10 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (parser_yyerror): preserve source code encoding in
Index: ruby_2_0_0/parse.y
===================================================================
--- ruby_2_0_0/parse.y	(revision 47402)
+++ ruby_2_0_0/parse.y	(revision 47403)
@@ -7980,7 +7980,7 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/parse.y#L7980
 
       default:
 	if (!parser_is_identchar()) {
-	    rb_compile_error(PARSER_ARG  "Invalid char `\\x%02X' in expression", c);
+	    compile_error(PARSER_ARG  "Invalid char `\\x%02X' in expression", c);
 	    goto retry;
 	}
 
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 47402)
+++ ruby_2_0_0/version.h	(revision 47403)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2014-09-05"
-#define RUBY_PATCHLEVEL 552
+#define RUBY_PATCHLEVEL 553
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 9
Index: ruby_2_0_0/test/ruby/test_parse.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_parse.rb	(revision 47402)
+++ ruby_2_0_0/test/ruby/test_parse.rb	(revision 47403)
@@ -658,8 +658,11 @@ x = __ENCODING__ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_parse.rb#L658
   end
 
   def test_invalid_char
+    bug10117 = '[ruby-core:64243] [Bug #10117]'
+    invalid_char = /Invalid char `\\x01'/
     x = 1
-    assert_equal(1, eval("\x01x"))
+    assert_in_out_err(%W"-e \x01x", "", [], invalid_char, bug10117)
+    assert_syntax_error("\x01x", invalid_char, bug10117)
     assert_equal(nil, eval("\x04x"))
   end
 

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r47098


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

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