Bugfixes: round 2 #17
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After a quick fix for the
goto locbug (#16), here's a couple of less urgent bugfixes, these on the decompiler side. Each commit fixes one specific bug.No more trailing spaces
Tickompiler's decompiler used to produce the following output per command (regex-like formatting used for clarity)
$operation(<$arg0>)? ($arguments.join(", "))?This means that if there were no arguments, there would be a trailing space at the end of the command. Extra checks have been added to ensure this doesn't happen, for a cleaner experience.
Make
starttake priority overassetsTickflow's decompiler had the following code:
This meant that if
startandassetshad the same value, the output Tickflow would look like this:Seeing how
startis required, butassetsis not, a small change has been added to ensure read order stays the same butassetsis assigned beforestart. This fix works for most cases, since ifstartmatchesassets, there's a chance they're both at position 0, which is the behavior Tickompiler's compiler defaults to.Fix decompilation of Tickflow files with a
bytesargument annotationThis bug, not unlike the previous one, only realistically applied to decompiling a .bin file that has previously been compiled by Tickompiler, which is why it slipped for so long. This issue would reveal itself in two different ways:
IllegalStateException: reached end of streamThis is all caused due to the decompiler's "first pass" not managing the
3argument annotation, which indicates abytesoperation. This would cause the first pass to reach end of stream if thebytesoperation was close enough to the end of the file, potentially skip over some markers, and make the position of strings remembered be offset from the actual position of the strings in the Tickflow. The first pass now properly managesbytes.The packer had a similar error, however, due to not interpreting the contents of the Tickflow, instead copying it, the worst it could do is skip some argument annotations due to reading raw bytes as a Tickflow opint. A fix has also been added for these less frequent but equally destructive situations.