Skip to content

pawndisasm: Minor fixes, code cleanup#424

Merged
Zeex merged 5 commits intopawn-lang:devfrom
Daniel-Cortez:pawndisasm-fixes
Jun 15, 2019
Merged

pawndisasm: Minor fixes, code cleanup#424
Zeex merged 5 commits intopawn-lang:devfrom
Daniel-Cortez:pawndisasm-fixes

Conversation

@Daniel-Cortez
Copy link
Contributor

What this PR does / why we need it:

  • Fixed input and output files not being properly closed and code being leaked on early returns.

  • Implemented proper handling for invalid instructions.
    Now instead of crashing on invalid instructions (due to OOB access to the opcode table) pawndisasm prints a proper error message with the code of invalid instruction and the address it was detected at.

  • Removed extra space after AMX flags.

  • Code cleanup.

    • Removed unused data from the opcode table.
      It seems that the opcode table was copied from sc6.c and sorted by opcode IDs instead of alphabetical order, but field OPCODE::opcode was left unused.
    • Removed opcode handler do_switch() (it was a duplicate of do_jump()).
    • Function casetbl() has been renamed into do_casetbl() to be more in-line with the names of the other opcode handlers.

Which issue(s) this PR fixes:

What kind of pull this is:

  • A Bug Fix
  • A New Feature
  • Some repository meta (documentation, etc)
  • Other

Additional Documentation:

@Daniel-Cortez Daniel-Cortez requested a review from a team as a code owner June 7, 2019 17:06
@Zeex
Copy link
Contributor

Zeex commented Jun 15, 2019

👍

@Zeex Zeex merged commit 382b30e into pawn-lang:dev Jun 15, 2019
@Daniel-Cortez Daniel-Cortez deleted the pawndisasm-fixes branch June 15, 2019 22:48
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