summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2023-02-08 17:37:25 -0800
committerTakashi Kokubun <[email protected]>2023-03-05 22:41:35 -0800
commit6bc8e4a279f953148e17b23b25f0db8d3d37fcbb (patch)
tree478354d20a3622bd08deaf35c8c7c315874f9bef
parent98a3b40d5517d0d7444597f49287830b8ec2f041 (diff)
Fix the operand for branchunless
-rw-r--r--lib/ruby_vm/mjit/insn_compiler.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ruby_vm/mjit/insn_compiler.rb b/lib/ruby_vm/mjit/insn_compiler.rb
index ed004c99e9..a4d79127be 100644
--- a/lib/ruby_vm/mjit/insn_compiler.rb
+++ b/lib/ruby_vm/mjit/insn_compiler.rb
@@ -342,8 +342,8 @@ module RubyVM::MJIT
# TODO: skip check for known truthy
# This `test` sets ZF only for Qnil and Qfalse, which let jz jump.
- asm.test([SP, C.VALUE.size * (ctx.stack_size - 1)], ~Qnil)
- ctx.stack_pop(1)
+ val = ctx.stack_pop
+ asm.test(val, ~Qnil)
# Set stubs
branch_stub = BranchStub.new(