Skip to content

Commit

Permalink
Fix block flipping in block_drop_unreferenced
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
muhmuhten authored and nicowilliams committed Feb 26, 2019
1 parent 9a0d5be commit 8537b93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ block block_drop_unreferenced(block body) {
if (curr->bound_by == curr && !curr->referenced) {
inst_free(curr);
} else {
refd = BLOCK(inst_block(curr), refd);
refd = BLOCK(refd, inst_block(curr));
}
}
return refd;
Expand Down

0 comments on commit 8537b93

Please sign in to comment.