decomp(ATERM): align option initialization scheduling #1097
Reference in New Issue
Block a user
Delete Branch "agent/bittle/aterm-option-init-order"
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?
One focused initialization-order change
Move the existing constant seven-byte optionIds declaration below the existing enabled = SOHtoNs(1) declaration in case 5. All other source bytes, types, assignments, scopes, helpers, configuration and symbol metadata stay fixed. Exactly one candidate was tried.
Target code loads gAtermRequestOptions, calls SOHtoNs, then initializes the option bytes. This motivates scheduling, not a unique original source-order or semantic-bug claim. The mutable pointer load remains before the call. The array initializer is purely constants; its address is not exposed before initialization. Actual original/current SOHtoNs is pinned to two instructions, masks r3 to16 bits and returns, with no memory or callback effects.
Independent parent verification
Freshly rebuilt on
02d634d30b. Tested tree9171db111effc40975cd574e895247b846f7ade8.No synthetic branches, padding, volatile casts, register forcing, assembly or undefined values. Evidence: tools/decomp-assist/aterm-option-initializer-order.attempts.md. Original binaries/disassembly are not uploaded. Draft for human review; no merge or auto-merge requested.
Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.