1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

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.
This commit is contained in:
Muh Muhten
2019-02-25 21:55:15 -05:00
committed by Nico Williams
parent 9a0d5be790
commit 8537b93a43

View File

@ -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;