Skip to content

Commit

Permalink
#245 ensure result is let 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 22e3339 commit 6fda06d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ravicomp/src/linearizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,19 +1273,19 @@ static Pseudo *indexed_load(Proc *proc, Pseudo *index_pseudo)
default:
break;
}
Pseudo *target_pseudo = allocate_temp_pseudo(proc, target_type, false);
Instruction *insn = allocate_instruction(proc, (enum opcode)op, line_number);
Pseudo *tofree1 = add_instruction_operand(proc, insn, container_pseudo);
Pseudo *tofree2 = add_instruction_operand(proc, insn, key_pseudo);
add_instruction_target(proc, insn, target_pseudo);
add_instruction(proc, insn);
free_temp_pseudo(proc, container_pseudo, false);
free_temp_pseudo(proc, key_pseudo, false);
index_pseudo->index_info.used = 1;
if (tofree1)
free_temp_pseudo(proc, tofree1, false);
if (tofree2)
free_temp_pseudo(proc, tofree2, false);
Pseudo *target_pseudo = allocate_temp_pseudo(proc, target_type, true);
add_instruction_target(proc, insn, target_pseudo);
add_instruction(proc, insn);
return target_pseudo;
}

Expand Down

0 comments on commit 6fda06d

Please sign in to comment.