Consider converting assembly to use macros instead of raw .word, .halfword, etc. to avoid alignment bugs #2141
Labels
Component: ASM/C
Changes some internals of the ASM/C libraries
Type: Maintenance
Code style, infrastructure, updating dependencies
Context: #2140
Data alignment bugs aren't obvious on review, and can be pretty subtle. Unfortunately armips doesn't seem to have any builtin way to specify "align by default" or anything like that, but it does support macros. If we broadly switched from raw
.word 0x42
to a macroalignedword 0x42
, defined asthat could set a pattern where things are aligned as needed by default.
Disclaimer: I'm not deeply familiar with the asm/C side of the randomizer, and there might be some reason I'm not seeing why we'd regularly want to avoid forcing alignment. But it seems like this would be a decent way to get rid of a subtle pitfall (and it should make it possible to rip out some of the explicit .align directives currently scattered through the .asm)
Main downside I see is just having to deal with a bunch of merge conflicts in forks that touch the .asm files...
The text was updated successfully, but these errors were encountered: