summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuh Muhten <muh.muhten@gmail.com>2019-02-25 21:55:15 -0500
committerNico Williams <nico@cryptonector.com>2019-02-26 10:49:08 -0600
commit8537b93a4301ecac98fb7dad92bba9cfd17a1f37 (patch)
tree9742e3229cf70d2c15218dc0294d65fb3308af69
parent9a0d5be790f0c89c02ffde11144157f067b19fd1 (diff)
Fix block flipping in block_drop_unreferenced
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.
-rw-r--r--src/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compile.c b/src/compile.c
index 75929aa9..6592b97e 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -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;