summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-02 12:55:57 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-05-02 12:55:57 +0000
commit14a3499c4f9dfc9ee102cbed5fe37481282f5f5a (patch)
tree31a55d8ea97454206dfc5688497e24cc1bd180e0 /test/ruby
parent0d492003b000e7808adf539502827da2472d7d73 (diff)
compile.c: mark catch_except_p of iseq
which has throw insn, not only ancestor iseqs of it. I think we should remove catch_except_p flag and try to simplify the catch table itself, to prevent similar bugs in the future. test_jit.rb: add test to prevent the bug git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_jit.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb
index 7542f8087e..040328533f 100644
--- a/test/ruby/test_jit.rb
+++ b/test/ruby/test_jit.rb
@@ -574,6 +574,17 @@ class TestJIT < Test::Unit::TestCase
end
end
+ def test_lambda_longjmp
+ assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: '5', success_count: 1)
+ begin;
+ fib = lambda do |x|
+ return x if x == 0 || x == 1
+ fib.call(x-1) + fib.call(x-2)
+ end
+ print fib.call(5)
+ end;
+ end
+
private
# The shortest way to test one proc