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

ruby-changes:35186

From: nagachika <ko1@a...>
Date: Mon, 25 Aug 2014 00:44:28 +0900 (JST)
Subject: [ruby-changes:35186] nagachika:r47268 (ruby_2_1): merge revision(s) r47098: [Backport #10117]

nagachika	2014-08-25 00:44:20 +0900 (Mon, 25 Aug 2014)

  New Revision: 47268

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

  Log:
    merge revision(s) r47098: [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_1/
  Modified files:
    branches/ruby_2_1/ChangeLog
    branches/ruby_2_1/parse.y
    branches/ruby_2_1/test/ruby/test_parse.rb
    branches/ruby_2_1/version.h
Index: ruby_2_1/ChangeLog
===================================================================
--- ruby_2_1/ChangeLog	(revision 47267)
+++ ruby_2_1/ChangeLog	(revision 47268)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1
+Mon Aug 25 00:36:56 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]
+
 Mon Aug 25 00:26:12 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (parser_yyerror): preserve source code encoding in
Index: ruby_2_1/parse.y
===================================================================
--- ruby_2_1/parse.y	(revision 47267)
+++ ruby_2_1/parse.y	(revision 47268)
@@ -8090,7 +8090,7 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/ruby_2_1/parse.y#L8090
 
       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_1/version.h
===================================================================
--- ruby_2_1/version.h	(revision 47267)
+++ ruby_2_1/version.h	(revision 47268)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1
 #define RUBY_VERSION "2.1.2"
 #define RUBY_RELEASE_DATE "2014-08-25"
-#define RUBY_PATCHLEVEL 208
+#define RUBY_PATCHLEVEL 209
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 8
Index: ruby_2_1/test/ruby/test_parse.rb
===================================================================
--- ruby_2_1/test/ruby/test_parse.rb	(revision 47267)
+++ ruby_2_1/test/ruby/test_parse.rb	(revision 47268)
@@ -658,8 +658,11 @@ x = __ENCODING__ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/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_1
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r47098


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

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