1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 50541,50542: [Backport #11159]

* iseq.c (rb_iseq_compile_with_option): check srouce type, must be
	  an IO or a String.  [ruby-core:69219] [Bug #11159]

	* iseq.c (rb_iseq_compile_with_option): check source type, must be


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@50543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2015-05-19 16:48:49 +00:00
parent c4e2e5df81
commit 73a48a1482
4 changed files with 16 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Wed May 20 01:47:23 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* iseq.c (rb_iseq_compile_with_option): check source type, must be
an IO or a String. [ruby-core:69219] [Bug #11159]
Fri May 15 05:01:25 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* symbol.c (Init_sym): make dsym_fstrs a hash compared by identity

1
iseq.c
View file

@ -596,6 +596,7 @@ rb_iseq_compile_with_option(VALUE src, VALUE file, VALUE absolute_path, VALUE li
if (RB_TYPE_P((src), T_FILE))
node = rb_parser_compile_file_path(parser, file, src, ln);
else {
StringValue(src);
node = rb_parser_compile_string_path(parser, file, src, ln);
if (!node) {

View file

@ -134,4 +134,11 @@ class TestISeq < Test::Unit::TestCase
assert(!op.to_s.match(/^opt_/), "#{op}")
}
end
def test_invalid_source
bug11159 = '[ruby-core:69219] [Bug #11159]'
assert_raise(TypeError, bug11159) {ISeq.compile(nil)}
assert_raise(TypeError, bug11159) {ISeq.compile(:foo)}
assert_raise(TypeError, bug11159) {ISeq.compile(1)}
end
end

View file

@ -1,10 +1,10 @@
#define RUBY_VERSION "2.2.3"
#define RUBY_RELEASE_DATE "2015-05-15"
#define RUBY_PATCHLEVEL 102
#define RUBY_RELEASE_DATE "2015-05-20"
#define RUBY_PATCHLEVEL 103
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 5
#define RUBY_RELEASE_DAY 15
#define RUBY_RELEASE_DAY 20
#include "ruby/version.h"