Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[decompiler] support break #516

Merged
merged 3 commits into from
May 24, 2021
Merged

[decompiler] support break #516

merged 3 commits into from
May 24, 2021

Conversation

water111
Copy link
Collaborator

Currently as a begin ending with a goto.

@coveralls
Copy link

coveralls commented May 22, 2021

Pull Request Test Coverage Report for Build 869709564

  • 106 of 169 (62.72%) changed or added relevant lines in 8 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 69.748%

Changes Missing Coverage Covered Lines Changed/Added Lines %
decompiler/IR2/FormExpressionAnalysis.cpp 25 29 86.21%
decompiler/analysis/cfg_builder.cpp 29 35 82.86%
decompiler/ObjectFile/ObjectFileDB_IR2.cpp 0 8 0.0%
decompiler/IR2/Form.cpp 27 49 55.1%
decompiler/Function/CfgVtx.cpp 9 32 28.13%
Files with Coverage Reduction New Missed Lines %
decompiler/ObjectFile/ObjectFileDB_IR2.cpp 1 0%
Totals Coverage Status
Change from base Build 869435161: 0.2%
Covered Lines: 35840
Relevant Lines: 51385

💛 - Coveralls

@water111
Copy link
Collaborator Author

  • Add some features to CfgVtx.cpp to support getting the destination of a break as a block index and figuring out which blocks need labels
  • Add labels as needed in cfg_builder based on the data from CfgVtx.cpp
  • Fix a bug where accessing a bitfield with a single right shift would give int in the decompiler always
  • Convert a break into code + a goto. I think in all cases random goto forwards end up turning into breaks, so trying to convert these into some block-like structure isn't always possible.
  • Recognize converting a symbol into a string.
  • Don't crash on failed stack spills
  • Clean up dead code in a break like we did for return
  • Decompile method 19 of res-lump. This now can be copy-pasted from the decompiler!

@water111 water111 marked this pull request as ready for review May 24, 2021 00:16
@water111 water111 merged commit d719bf5 into master May 24, 2021
@water111 water111 deleted the w/support-break-in-decompiler branch May 24, 2021 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants