diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-13 21:14:46 -0800 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-13 21:14:47 -0800 |
| commit | 96d29dff66a0d2e045d09ce6bb7bb3b382c59c2c (patch) | |
| tree | f2c3312386c67f8ad19d0f0e6990d968438fc883 /lib/mjit | |
| parent | 3dd4e381fe3c7faf886145ad7ab2152c6b199d69 (diff) | |
Fix invokebuiltin in Ruby MJIT
https://github.com/ruby/ruby/blob/45fe7f757522ed7d1d3ec754da59d41d45dd6bab/tool/ruby_vm/views/_mjit_compile_invokebuiltin.erb#L21
has not been ported correctly.
Diffstat (limited to 'lib/mjit')
| -rw-r--r-- | lib/mjit/compiler.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mjit/compiler.rb b/lib/mjit/compiler.rb index 9e6ea0a119..db8327b863 100644 --- a/lib/mjit/compiler.rb +++ b/lib/mjit/compiler.rb @@ -446,9 +446,10 @@ module RubyVM::MJIT def compile_invokebuiltin(f, insn, stack_size, sp_inc, body, operands) bf = C.RB_BUILTIN.new(operands[0]) if bf.compiler > 0 + index = (insn.name == :invokebuiltin ? -1 : operands[1]) C.fprintf(f, "{\n") C.fprintf(f, " VALUE val;\n") - C.builtin_compiler(f, bf, operands[1], stack_size, body.builtin_inline_p) + C.builtin_compiler(f, bf, index, stack_size, body.builtin_inline_p) C.fprintf(f, " stack[#{stack_size + sp_inc - 1}] = val;\n") C.fprintf(f, "}\n") return true |
