Skip to content

Commit

Permalink
[moar] Fix nqp::falsey with int32 argument
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Nov 9, 2018
1 parent 54242a6 commit 22ecefd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/vm/moar/NQP/Ops.nqp
Expand Up @@ -110,11 +110,9 @@ $ops.add_hll_op('nqp', 'falsey', -> $qastcomp, $op {
}
elsif $val.result_kind == $MVM_reg_int32 {
my $not_reg := $regalloc.fresh_register($MVM_reg_int64);
my @ins := $val.instructions;

push_op(@ins, 'extend_i32', $not_reg, $val.result_reg);
push_op(@ins, 'not_i', $not_reg, $not_reg);
MAST::InstructionList.new(@ins, $not_reg, $MVM_reg_int64)
MAST::Op.new(:op<extend_i32>, $not_reg, $val.result_reg);
MAST::Op.new(:op<not_i>, $not_reg, $not_reg);
MAST::InstructionList.new($not_reg, $MVM_reg_int64)
}
elsif $val.result_kind == $MVM_reg_obj {
my $not_reg := $regalloc.fresh_register($MVM_reg_int64);
Expand Down

0 comments on commit 22ecefd

Please sign in to comment.