summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-24 15:44:20 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-24 15:44:20 +0000
commita4f174ac302ec6f8b52091a27ddb6aaab5319e23 (patch)
treec7802e1468e26ffc95d4bdedc4d1a6e1a2b7f2b2
parent9704c840361094663bf276131ad754a05736eaab (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47268 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 034fa785a5..44e30b830a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Aug 25 00:36:56 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]
+
Mon Aug 25 00:26:12 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 7f0c3525a0..cc3a638b36 100644
--- a/parse.y
+++ b/parse.y
@@ -8090,7 +8090,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 863d379096..9ef311b934 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 93d441f8ed..555bc7b605 100644
--- a/version.h
+++ b/version.h
@@ -1,6 +1,6 @@
#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