diff options
author | Matt Valentine-House <matt@eightbitraptor.com> | 2023-11-02 22:37:30 +0000 |
---|---|---|
committer | Matt Valentine-House <matt@eightbitraptor.com> | 2023-11-03 07:28:05 +0000 |
commit | dcb9ded6c9148a31361ba2318ed7d57fd0c41431 (patch) | |
tree | 7605059182e7dac9e06e06d1d6c537a9fbe70723 /prism_compile.c | |
parent | 5cff4c5aa375787924e2df5c0b981dd922b95a8c (diff) | |
download | ruby-dcb9ded6c9148a31361ba2318ed7d57fd0c41431.tar.gz |
[PRISM] Fix CallNode with arguments when popped
Previously emitting a call node with an argument followed by another
node would cause the argument to be mistakenly omitted from the argument
list causing a stack underflow.
```
PRISM: **************************************************
-- raw disasm--------
0000 putself ( 0)
0001 send <calldata:puts, 1>, nil ( 0)
* 0004 pop ( 0)
0005 putobject 1 ( 0)
0007 leave ( 0)
---------------------
```
Diffstat (limited to 'prism_compile.c')
-rw-r--r-- | prism_compile.c | 2 |
1 files changed, 1 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 |