Skip to content
Myr

Fix block flipping in block_drop_unreferenced

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Since 605bfb3, block_drop_unreferenced actually reverses the order of instructions in the block it's run against. This bug was hidden by the fact that normally it's run *twice* against the main program, flipping it back, and that order of function definitionss doesn't really matter after symbol resolution.

authored by Muh Muhten · committed by Nico Williams · parent 9a0d5be · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/compile.c+1 added-1 removed
501 unmodified lines
502 while ((curr = block_take(&body))) {503 if (curr->bound_by == curr && !curr->referenced) {504 inst_free(curr);505 } else {506 refd = BLOCK(inst_block(curr), refd);506 refd = BLOCK(refd, inst_block(curr));507 }508 }509 return refd;510}
912 unmodified lines