Skip to content

Commit

Permalink
Fix some MAST::Label constructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Aug 29, 2013
1 parent 1b4f79d commit 4a3df63
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions nqp-cc/src/QASTOperationsMAST.nqp
Expand Up @@ -484,8 +484,8 @@ for <if unless> -> $op_name {

# Create labels.
my $if_id := $qastcomp.unique($op_name);
my $else_lbl := MAST::Label.new($if_id ~ '_else');
my $end_lbl := MAST::Label.new($if_id ~ '_end');
my $else_lbl := MAST::Label.new(:name($if_id ~ '_else'));
my $end_lbl := MAST::Label.new(:name($if_id ~ '_end'));

# Compile each of the children, handling any that want the conditional
# value to be passed.
Expand Down Expand Up @@ -622,7 +622,7 @@ QAST::MASTOperations.add_core_op('defor', -> $qastcomp, $op {

# Emit defined check.
my $def_reg := $*REGALLOC.fresh_i();
my $lbl := MAST::Label.new($qastcomp.unique('defor'));
my $lbl := MAST::Label.new(:name($qastcomp.unique('defor')));
push_op($expr.instructions, 'set', $res_reg, $expr.result_reg);
push_op($expr.instructions, 'isconcrete', $def_reg, $res_reg);
push_op($expr.instructions, 'if_i', $def_reg, $lbl);
Expand Down Expand Up @@ -651,7 +651,7 @@ QAST::MASTOperations.add_core_op('ifnull', -> $qastcomp, $op {
my $expr := $qastcomp.as_mast($op[0], :want($MVM_reg_obj));

# Emit null check.
my $lbl := MAST::Label.new($qastcomp.unique('ifnull'));
my $lbl := MAST::Label.new(:name($qastcomp.unique('ifnull')));
push_op($expr.instructions, 'set', $res_reg, $expr.result_reg);
push_op($expr.instructions, 'ifnonnull', $expr.result_reg, $lbl);

Expand All @@ -674,11 +674,10 @@ for ('', 'repeat_') -> $repness {
QAST::MASTOperations.add_core_op("$repness$op_name", -> $qastcomp, $op {
# Create labels.
my $while_id := $qastcomp.unique($op_name);
my $test_lbl := MAST::Label.new($while_id ~ '_test');
my $next_lbl := MAST::Label.new($while_id ~ '_next');
my $redo_lbl := MAST::Label.new($while_id ~ '_redo');
my $hand_lbl := MAST::Label.new($while_id ~ '_handlers');
my $done_lbl := MAST::Label.new($while_id ~ '_done');
my $test_lbl := MAST::Label.new(:name($while_id ~ '_test'));
my $next_lbl := MAST::Label.new(:name($while_id ~ '_next'));
my $redo_lbl := MAST::Label.new(:name($while_id ~ '_redo'));
my $done_lbl := MAST::Label.new(:name($while_id ~ '_done'));

# Compile each of the children; we'll need to look at the result
# types and pick an overall result type if in non-void context.
Expand Down

0 comments on commit 4a3df63

Please sign in to comment.