diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-19 09:54:44 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-19 09:54:44 +0000 |
commit | 1bd09d5d5d3bdcc447f21405ef6cd9fa4b95e4f6 (patch) | |
tree | e30282df63f5d905f8522e321e2529bf97c26c57 /test/ruby | |
parent | 7b6862e53e85074edea27688f4f88322324b59f3 (diff) | |
download | ruby-1bd09d5d5d3bdcc447f21405ef6cd9fa4b95e4f6.tar.gz |
iseq.c: check srouce type
* iseq.c (rb_iseq_compile_with_option): check srouce type, must be
an IO or a String. [ruby-core:69219] [Bug #11159]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_iseq.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_iseq.rb b/test/ruby/test_iseq.rb index 4af440ae42..686646ddd8 100644 --- a/test/ruby/test_iseq.rb +++ b/test/ruby/test_iseq.rb @@ -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 |