Include imm16's in the word count (fix the infinite loop bug yay!)
This commit is contained in:
@@ -30,7 +30,7 @@ void addInstructionToProgram(Program* program, Instruction inst) {
|
||||
}
|
||||
|
||||
if (program->len + 1 >= program->capacity) {
|
||||
Instruction* tmp = malloc(sizeof(Instruction) * program->capacity * 2);
|
||||
Instruction* tmp = realloc(program->at, sizeof(Instruction) * program->capacity * 2);
|
||||
if (tmp == NULL) {
|
||||
fprintf(stderr, "malloc failed while expanding program\n");
|
||||
exit(1);
|
||||
@@ -50,7 +50,7 @@ void addLabelToProgram(Program* program, const char* name, uint8_t position) {
|
||||
}
|
||||
|
||||
if (program->labels.len + 1 >= program->labels.capacity) {
|
||||
Label* tmp = malloc(sizeof(Label) * program->labels.capacity * 2);
|
||||
Label* tmp = realloc(program->labels.at, sizeof(Label) * program->labels.capacity * 2);
|
||||
if (tmp == NULL) {
|
||||
fprintf(stderr, "malloc failed while expanding program labels\n");
|
||||
exit(1);
|
||||
|
||||
Reference in New Issue
Block a user