Repository navigation
Reimport no longer fails when an overlay's function shares an address with the main code's - #123
Merged
Merged
Conversation
… with the main code's Reimport paired each new function with the old one at its address using a lookup that holds one function per address. A game whose overlay puts a second function at an address the main code already has (PS2: 53 of them in one game) left the second twin unpaired, and its name, held by the old twin, was inserted again: UNIQUE constraint failed. Each address now keeps all its functions, and each old function pairs once, the one with the same name first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to #107 and #117. Reimporting a project made with an older version failed with
UNIQUE constraint failed: functions.project_id, functions.name(in_import_split). Cause: reimport pairs each old function with a new one by address, using a lookup that holds one function per address. A game whose overlay puts a second function at an address the main code already uses (53 such addresses in one PS2 game) leaves the second twin unpaired, and its name, still held by the old twin, is inserted again. Fix: the pairing is nowpair_old_functions: every function at an address is kept, each old function pairs once, matched by same name first, then address, then name. Tested: a new unit test (twins, a function renamed since the first import, a function new in the split); the existing reimport tests; the full suite, which passes except two tests that also fail on main (usage-limit time parsing, tray GTK check). Ran live: a PS2 project (18,335 functions) imported on 1.0.6-alpha.3 failed to reimport on 1.0.6-alpha.4 with the room fixes from #117, and now completes with 4,702 matched functions kept. Not tested on other consoles.