Skip to content

Commit

Permalink
REPL: fix bug too lazy to explain it
Browse files Browse the repository at this point in the history
  • Loading branch information
mrunix00 committed Jul 29, 2024
1 parent 85e06d1 commit 0382717
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

void printTopStack(const VM &vm, const Program &program) {
if (vm.stackSize == 0) return;
auto last_instruction = program.segments[0].instructions.back();
auto number_of_instructions = program.segments[0].instructions.size();
auto last_instruction = program.segments[0].instructions[number_of_instructions - 2];
auto type = getInstructionType(program, last_instruction);
switch (type) {
case VariableType::Bool:
Expand Down

0 comments on commit 0382717

Please sign in to comment.