Skip to content

Commit

Permalink
fix: REPL shell crashes when defining functions fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrunix00 committed Apr 17, 2024
1 parent b6484c0 commit 275840b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/bytecode/vm/Interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ void Bytecode::Interpreter::execute(const Program &program) {
for (;; stackTop->current_line++) {
const auto currentSegment =
program.segments[stackTop->segment];
const auto currentInstruction =
currentSegment->instructions[stackTop->current_line];
if (stackTop->segment == 0
&& currentSegment->instructions.size() == stackTop->current_line)
&& stackTop->current_line == currentSegment->instructions.size())
return;
const auto currentInstruction =
currentSegment->instructions[stackTop->current_line];

switch (currentInstruction->type) {
case InstructionType::Add: {
const auto object2 = vm.program_stack.pop();
Expand Down

0 comments on commit 275840b

Please sign in to comment.