Closed Frostbyte0x70 closed 1 year ago
Originally reported at https://discord.com/channels/710190644152369162/1002325768682090636/1002330772272857239
The following code triggers a KeyError after compiling the script, deleting the original ExplorerScript source and trying to decompile it again:
def 0 { call @something; end; §something; return; }
The call opcode can be replaced with a jump, both produce the same result.
call
jump
The exception is raised at https://github.com/SkyTemple/ExplorerScript/blob/ca2502370eab78aba95e243225e17380b6413c9e/explorerscript/ssb_converting/decompiler/graph_building/graph_minimizer.py#L709, because label_indices is empty. The reason why it's empty is because no elements were added to it at https://github.com/SkyTemple/ExplorerScript/blob/ca2502370eab78aba95e243225e17380b6413c9e/explorerscript/ssb_converting/decompiler/graph_building/graph_minimizer.py#L54, since there weren't any SsbLabel in the list of opcodes.
label_indices
SsbLabel
Originally reported at https://discord.com/channels/710190644152369162/1002325768682090636/1002330772272857239
The following code triggers a KeyError after compiling the script, deleting the original ExplorerScript source and trying to decompile it again:
The
call
opcode can be replaced with ajump
, both produce the same result.The exception is raised at https://github.com/SkyTemple/ExplorerScript/blob/ca2502370eab78aba95e243225e17380b6413c9e/explorerscript/ssb_converting/decompiler/graph_building/graph_minimizer.py#L709, because
label_indices
is empty. The reason why it's empty is because no elements were added to it at https://github.com/SkyTemple/ExplorerScript/blob/ca2502370eab78aba95e243225e17380b6413c9e/explorerscript/ssb_converting/decompiler/graph_building/graph_minimizer.py#L54, since there weren't anySsbLabel
in the list of opcodes.