Caught an error in the compiler

This commit is contained in:
2023-02-04 03:03:56 +00:00
parent 2776c87026
commit 2f1613e306
2 changed files with 3 additions and 3 deletions

View File

@@ -365,7 +365,7 @@ static Toy_Opcode Toy_writeCompilerWithJumps(Toy_Compiler* compiler, Toy_ASTNode
//write the else path
Toy_Opcode override2 = Toy_writeCompilerWithJumps(compiler, node->pathIf.elsePath, breakAddressesPtr, continueAddressesPtr, jumpOffsets, rootNode);
if (override2 != TOY_OP_EOF) {//compensate for indexing & dot notation being screwy
compiler->bytecode[compiler->count++] = (unsigned char)override; //1 byte
compiler->bytecode[compiler->count++] = (unsigned char)override2; //1 byte
}
//update the jumpToEnd to point here