Add alignas specifiers to some arrays based on how they're accessed (#1933)

* Align some two-element `u32` arrays as `u64`s

- To pacify "unaligned read/write" warnings from UBSan

* Align some more arrays based on how they're accessed
This commit is contained in:
Jesse Talavera
2023-12-26 16:09:39 -05:00
committed by GitHub
parent ab8938a695
commit cbd65a131e
2 changed files with 24 additions and 24 deletions

View File

@ -259,8 +259,8 @@ public: // TODO: Encapsulate the rest of these members
u16 PowerControl9;
u16 ExMemCnt[2];
u8 ROMSeed0[2*8];
u8 ROMSeed1[2*8];
alignas(u32) u8 ROMSeed0[2*8];
alignas(u32) u8 ROMSeed1[2*8];
protected:
// These BIOS arrays should be declared *before* the component objects (JIT, SPI, etc.)
@ -489,12 +489,12 @@ private:
FIFO<u32, 16> IPCFIFO9; // FIFO in which the ARM9 writes
FIFO<u32, 16> IPCFIFO7;
u16 DivCnt;
u32 DivNumerator[2];
u32 DivDenominator[2];
u32 DivQuotient[2];
u32 DivRemainder[2];
alignas(u64) u32 DivNumerator[2];
alignas(u64) u32 DivDenominator[2];
alignas(u64) u32 DivQuotient[2];
alignas(u64) u32 DivRemainder[2];
u16 SqrtCnt;
u32 SqrtVal[2];
alignas(u64) u32 SqrtVal[2];
u32 SqrtRes;
u16 KeyCnt[2];
bool Running;