While list is backpatching

This commit is contained in:
Meyer Simon
2025-05-01 16:43:00 -04:00
parent 99dffaee01
commit c2132ddd00
3 changed files with 25 additions and 0 deletions

View File

@ -57,6 +57,12 @@ int S_Size(Stack *s){
}
return s->size;
}
void emit_backpatch(Stack * s, int l){
for (Instruction * i = S_Pop(s); i; i = S_Pop(s)){
i->label = l;
}
}
//_______________________________________________________________________
char * temp = NULL;
@ -72,6 +78,7 @@ void emit_push_all(Stack * s){
for (Instruction * i = S_Pop(s); i; i = S_Pop(s)){
current->next = i;
i->prev = current;
i->index = current->index + 1;
current = i;
current->next = NULL;
}