summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 04:54:26 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 04:54:26 +0000
commitb7a3410641ec76769496d7e2d71f369f3add0b44 (patch)
treea808e9a6e59df4338622e93d7bcc216c2984a31f
parent98e5eb6f394562b7bdae830424eda43f6b5f22f7 (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--parse.y2
-rw-r--r--test/ruby/test_parse.rb5
-rw-r--r--version.h2
4 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 65f56116c5..abfb5ef9e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Sep 5 13:53:41 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* parse.y (parser_yyerror): preserve source code encoding in
diff --git a/parse.y b/parse.y
index 7da5e1e269..f51e8a4b92 100644
--- a/parse.y
+++ b/parse.y
@@ -7980,7 +7980,7 @@ parser_yylex(struct parser_params *parser)
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;
}
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb
index 05fedb7ca6..6f329aac6d 100644
--- a/test/ruby/test_parse.rb
+++ b/test/ruby/test_parse.rb
@@ -658,8 +658,11 @@ x = __ENCODING__
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
diff --git a/version.h b/version.h
index 8cb601b4af..9626af4114 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#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