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

ruby-changes:50755

From: usa <ko1@a...>
Date: Wed, 28 Mar 2018 13:49:46 +0900 (JST)
Subject: [ruby-changes:50755] usa:r62938 (ruby_2_3): merge revision(s) 61346: [Backport #14206]

usa	2018-03-28 13:49:41 +0900 (Wed, 28 Mar 2018)

  New Revision: 62938

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

  Log:
    merge revision(s) 61346: [Backport #14206]
    
    parse.y: end of script at newline
    
    * parse.y (parser_yylex): deal with end of script chars just after
      ignored newline as other places.  [ruby-core:84349] [Bug #14206]

  Modified directories:
    branches/ruby_2_3/
  Modified files:
    branches/ruby_2_3/ChangeLog
    branches/ruby_2_3/parse.y
    branches/ruby_2_3/test/ruby/test_parse.rb
    branches/ruby_2_3/version.h
Index: ruby_2_3/version.h
===================================================================
--- ruby_2_3/version.h	(revision 62937)
+++ ruby_2_3/version.h	(revision 62938)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1
 #define RUBY_VERSION "2.3.7"
 #define RUBY_RELEASE_DATE "2018-03-28"
-#define RUBY_PATCHLEVEL 434
+#define RUBY_PATCHLEVEL 435
 
 #define RUBY_RELEASE_YEAR 2018
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_3/parse.y
===================================================================
--- ruby_2_3/parse.y	(revision 62937)
+++ ruby_2_3/parse.y	(revision 62938)
@@ -8195,8 +8195,8 @@ parser_yylex(struct parser_params *parse https://github.com/ruby/ruby/blob/trunk/ruby_2_3/parse.y#L8195
 	    }
 	    goto retry;
 	}
-	while ((c = nextc())) {
-	    switch (c) {
+	while (1) {
+	    switch (c = nextc()) {
 	      case ' ': case '\t': case '\f': case '\r':
 	      case '\13': /* '\v' */
 		space_seen = 1;
Index: ruby_2_3/test/ruby/test_parse.rb
===================================================================
--- ruby_2_3/test/ruby/test_parse.rb	(revision 62937)
+++ ruby_2_3/test/ruby/test_parse.rb	(revision 62938)
@@ -899,6 +899,12 @@ x = __ENCODING__ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/ruby/test_parse.rb#L899
     assert_equal(line, obj.location.lineno, bug)
   end
 
+  def test_eof_in_def
+    assert_raise(SyntaxError) { eval("def m\n\0""end") }
+    assert_raise(SyntaxError) { eval("def m\n\C-d""end") }
+    assert_raise(SyntaxError) { eval("def m\n\C-z""end") }
+  end
+
 =begin
   def test_past_scope_variable
     assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}}
Index: ruby_2_3/ChangeLog
===================================================================
--- ruby_2_3/ChangeLog	(revision 62937)
+++ ruby_2_3/ChangeLog	(revision 62938)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1
+Thu Mar 28 13:48:35 2018  Nobuyoshi Nakada  <nobu@r...>
+
+	parse.y: end of script at newline
+
+	* parse.y (parser_yylex): deal with end of script chars just after
+	  ignored newline as other places. [Bug #14206]
+
 Thu Mar 28 13:42:55 2018  Kazuhiro NISHIYAMA  <zn@m...>
 
 	[DOC] IO.new accepts external_encoding
Index: ruby_2_3
===================================================================
--- ruby_2_3	(revision 62937)
+++ ruby_2_3	(revision 62938)

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

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

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