Fix SD switch dispatch hidden by instruction-only matching #623
Reference in New Issue
Block a user
Delete Branch "agent/bittle/sd-state-switch-tables"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Actual data/behavior error
Both
processWorkerStateandcalcNormalalready have byte-identical instruction streams, but their reconstructed switch case values generated incorrect jump-table destinations. Correct those case labels from the original.rela.dataentries, retaining the existing block order.All mappings were derived by matching each original function-relative jump destination to the identical compiled instruction block. This is not a compiler/register-allocation workaround, metadata edit, table ownership move or hand-authored data table.
Fresh verification
Rebased on
7dea4122. Fresh source/reference builds, full 43U target and report, compared with separately rebuilt main..datarelocation entries corrected and no other source-data relocation changed..textsection is byte-for-byte unchanged.all_source, report andbuild/43U/okpass; SHA-1 26116613f624061ba99c8d1a299aaa6efa85670d. The unit remains NonMatching, so the DOL continues using the original object.This fixes the reconstructed source's dispatch semantics rather than chasing a score. It was found by checking jump-table relocations for functions already instruction-exact. Left for Cole's review and merge.
Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.