Skip to content

Commit

Permalink
#245 ensure we leave result on top of virtual stack
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Jun 25, 2022
1 parent 97c798e commit f34847c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ravicomp/src/linearizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,8 @@ static Pseudo *linearize_bool(Proc *proc, AstNode *node, bool is_and)
BasicBlock *first_block = create_block(proc);
BasicBlock *end_block = create_block(proc);

Pseudo *result = allocate_temp_pseudo(proc, RAVI_TANY, false);
// leave the result register on top of virtual stack
Pseudo *result = allocate_temp_pseudo(proc, RAVI_TANY, true);
Pseudo *operand1 = linearize_expression(proc, e1);
instruct_move(proc, op_mov, result, operand1, node->line_number);
free_temp_pseudo(proc, operand1, false);
Expand All @@ -906,7 +907,6 @@ static Pseudo *linearize_bool(Proc *proc, AstNode *node, bool is_and)
instruct_br(proc, allocate_block_pseudo(proc, end_block), node->line_number);

start_block(proc, end_block, node->line_number);

return result;
}

Expand Down

0 comments on commit f34847c

Please sign in to comment.