diff options
-rw-r--r-- | prism_compile.c | 2 | ||||
-rw-r--r-- | test/ruby/test_compile_prism.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/prism_compile.c b/prism_compile.c index 268055fae3..9052ab8fe9 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -1403,7 +1403,7 @@ pm_setup_args(pm_arguments_node_t *arguments_node, int *flags, struct rb_callinf default: { orig_argc++; post_splat_counter++; - PM_COMPILE(argument); + PM_COMPILE_NOT_POPPED(argument); if (has_splat) { // If the next node starts the keyword section of parameters diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index eb6a4f8b9a..494b8c87d2 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -694,6 +694,12 @@ module Prism def test_CallNode assert_prism_eval("to_s") + + # with arguments + assert_prism_eval("eval '1'") + + # with arguments and popped + assert_prism_eval("eval '1'; 1") end def test_CallAndWriteNode |