diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2024-01-16 10:30:31 -0500 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2024-01-16 12:55:57 -0500 |
| commit | 07b9b53459d1842e7066b248d48ef4952c6868d3 (patch) | |
| tree | 6bec9e8a5244c4b80dfb886fbb145803ff91ca8a /test/ruby | |
| parent | 7bd7030a96cdc106e347e0d48cfacfb80fb0f8db (diff) | |
[PRISM] Fix crash with empty ensure blocks
Fixes ruby/prism#2179.
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index cd521e6766..bc9f0b3aba 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -962,6 +962,22 @@ module Prism end prism_test_ensure_node CODE + + # Test empty ensure block + assert_prism_eval(<<~RUBY) + res = [] + + begin + begin + raise + ensure + end + rescue + res << "rescue" + end + + res + RUBY end def test_NextNode |
