From 0c662b34313699223f08df54c5dcd8c481ff8a95 Mon Sep 17 00:00:00 2001 From: normal Date: Wed, 3 Dec 2014 22:03:59 +0000 Subject: iseq.c: avoid segfault on incomplete iseq Compile failures will trigger iseq_free before iseq->callinfo_entries are allocated at all. * iseq.c (iseq_free): avoid segfault on incomplete iseq * test/ruby/test_syntax.rb (test_invalid_next): new test for syntax error, not segfault git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_syntax.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index d36cbb0638..38799a841e 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -364,6 +364,10 @@ WARN } end + def test_invalid_next + assert_syntax_error("def m; next; end", /Invalid next/) + end + def test_lambda_with_space feature6390 = '[ruby-dev:45605]' assert_valid_syntax("-> (x, y) {}", __FILE__, feature6390) -- cgit v1.2.3