diff options
| author | Kazuki Yamaguchi <k@rhe.jp> | 2024-12-20 15:37:10 +0900 |
|---|---|---|
| committer | Kevin Newton <kddnewton@gmail.com> | 2024-12-20 08:19:09 -0500 |
| commit | 0397bfa2c83f442cb46dd0219d30c52aa7ff6d16 (patch) | |
| tree | e1192eba82e71547d9c388a8952934e64994200b /test | |
| parent | b53a75230feb1db64320545ae45514ebd8d4c535 (diff) | |
[PRISM] Fix compiling popped opt_str_uminus and opt_str_freeze
Put a pop as needed. This example currently causes [BUG]:
$ ruby --parser=prism -e'1.times{"".freeze;nil}'
-e:1: [BUG] Stack consistency error (sp: 15, bp: 14)
ruby 3.4.0dev (2024-12-20T00:48:01Z master 978df259ca) +PRISM [x86_64-linux]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12410
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index 25f098f562..d182549b13 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -1993,6 +1993,10 @@ end end test_prism_call_node CODE + + # Specialized instructions + assert_prism_eval(%{-"literal"}) + assert_prism_eval(%{"literal".freeze}) end def test_CallAndWriteNode |
