Fixed a string comparison bug

This commit is contained in:
2022-08-05 17:11:21 +01:00
parent 8f2ba5cd50
commit bfaf4e83bb
5 changed files with 15 additions and 12 deletions

View File

@@ -20,7 +20,7 @@ void initCompiler(Compiler* compiler) {
void writeCompiler(Compiler* compiler, Node* node) {
//grow if the bytecode space is too small
if (compiler->capacity < compiler->count + 8) { //assume 8 is the maximum space needed by each instruction (can change later)
if (compiler->capacity < compiler->count + 1) {
int oldCapacity = compiler->capacity;
compiler->capacity = GROW_CAPACITY(oldCapacity);