MinecraftForge / ForgeFlower

Forge's modifications to FernFlower. Fixing various bugs/inconsistencies. Main Repo: https://github.com/MinecraftForge/FernFlower
Apache License 2.0
80 stars 44 forks source link

Fix loops inside of try-catch decompiling improperly #124

Closed jaskarth closed 1 year ago

jaskarth commented 1 year ago

When loops are nested inside of try catch blocks, the graph parsing algorithm has a hard time figuring out how to order the blocks. Before the patch, ForgeFlower would build the statements from the inside out as BasicBlock -> If -> TryCatch -> Loop, but this patch delays the creation of the trycatch block if there are any unresolved edges in the continueSet. The delay results in the order becoming BasicBlock -> If -> Loop -> TryCatch, which is the correct order. This patch fixes two instances of this bug in RconClient and ChaseServer, eliminating the need for the RconClient patch.

Fixes #73 (ClientThread in mcp is RconClient in moj) Diff: 1.19.2 diff