aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_syntax.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-29 05:39:03 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-29 05:39:03 +0000
commita287b53edd0a153695db628ae21c1328b5025c24 (patch)
tree837f4c9da5f7be9aaa095056885220b80e29343b /test/ruby/test_syntax.rb
parent9dd4ccf16994ff6228ab9afb33f2df4556212a28 (diff)
downloadruby-a287b53edd0a153695db628ae21c1328b5025c24.tar.gz
parse.y: check NTH_REF range
* compile.c (iseq_compile_each): out of range NTH_REF is always nil. * parse.y (parse_numvar): check overflow of NTH_REF and range. [ruby-core:69393] [Bug #11192] * util.c (ruby_scan_digits): make public and add length parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r--test/ruby/test_syntax.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb
index 21752e20d3..189cf1358d 100644
--- a/test/ruby/test_syntax.rb
+++ b/test/ruby/test_syntax.rb
@@ -579,6 +579,13 @@ eom
assert_syntax_error('0...%w.', /unterminated string/, bug10957)
end
+ def test_too_big_nth_ref
+ bug11192 = '[ruby-core:69393] [Bug #11192]'
+ assert_warn(/too big/, bug11192) do
+ eval('$99999999999999999')
+ end
+ end
+
private
def not_label(x) @result = x; @not_label ||= nil end