Skip to content

Commit

Permalink
ARM: fix out-of-bounds accesses during CPU mode switch from or into a…
Browse files Browse the repository at this point in the history
…n invalid mode
  • Loading branch information
fleroviux committed Jan 21, 2025
1 parent e1990a7 commit 8c25d6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/nba/include/nba/save_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace nba {

struct SaveState {
static constexpr u32 kMagicNumber = 0x5353424E; // NBSS
static constexpr u32 kCurrentVersion = 9;
static constexpr u32 kCurrentVersion = 10;

u32 magic;
u32 version;
Expand All @@ -25,9 +25,9 @@ struct SaveState {
struct ARM {
struct RegisterFile {
u32 gpr[16];
u32 bank[6][7];
u32 bank[7][7];
u32 cpsr;
u32 spsr[6];
u32 spsr[7];
} regs;

struct Pipeline {
Expand Down
2 changes: 1 addition & 1 deletion src/nba/src/arm/state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ enum Bank {
BANK_ABT = 3,
BANK_IRQ = 4,
BANK_UND = 5,
BANK_INVALID = 6,
BANK_COUNT,
BANK_INVALID
};

enum Condition {
Expand Down

0 comments on commit 8c25d6b

Please sign in to comment.