Skip to content

Commit

Permalink
Add an assert to try to track down a mysterious reported crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Sep 21, 2023
1 parent 1cb8bf3 commit 8a90e94
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Core/MIPS/ARM/ArmJit.cpp
Expand Up @@ -255,6 +255,7 @@ void ArmJit::Compile(u32 em_address) {
int block_num = blocks.AllocateBlock(em_address);
JitBlock *b = blocks.GetBlock(block_num);
DoJit(em_address, b);
_assert_msg_(b->originalAddress == em_address, "original %08x != em_address %08x (block %d)", b->originalAddress, em_address, b->blockNum);
blocks.FinalizeBlock(block_num, jo.enableBlocklink);

EndWrite();
Expand Down Expand Up @@ -301,7 +302,8 @@ MIPSOpcode ArmJit::GetOffsetInstruction(int offset) {
const u8 *ArmJit::DoJit(u32 em_address, JitBlock *b)
{
js.cancel = false;
js.blockStart = js.compilerPC = mips_->pc;
js.blockStart = em_address;
js.compilerPC = em_address;
js.lastContinuedPC = 0;
js.initialBlockSize = 0;
js.nextExit = 0;
Expand Down
6 changes: 3 additions & 3 deletions Core/MIPS/ARM64/Arm64Jit.cpp
Expand Up @@ -253,8 +253,8 @@ void Arm64Jit::Compile(u32 em_address) {
int block_num = blocks.AllocateBlock(em_address);
JitBlock *b = blocks.GetBlock(block_num);
DoJit(em_address, b);
_assert_msg_(b->originalAddress == em_address, "original %08x != em_address %08x (block %d)", b->originalAddress, em_address, b->blockNum);
blocks.FinalizeBlock(block_num, jo.enableBlocklink);

EndWrite();

// Don't forget to zap the newly written instructions in the instruction cache!
Expand Down Expand Up @@ -302,8 +302,8 @@ MIPSOpcode Arm64Jit::GetOffsetInstruction(int offset) {

const u8 *Arm64Jit::DoJit(u32 em_address, JitBlock *b) {
js.cancel = false;
js.blockStart = mips_->pc;
js.compilerPC = mips_->pc;
js.blockStart = em_address;
js.compilerPC = em_address;
js.lastContinuedPC = 0;
js.initialBlockSize = 0;
js.nextExit = 0;
Expand Down
4 changes: 3 additions & 1 deletion Core/MIPS/x86/Jit.cpp
Expand Up @@ -315,6 +315,7 @@ void Jit::Compile(u32 em_address) {
int block_num = blocks.AllocateBlock(em_address);
JitBlock *b = blocks.GetBlock(block_num);
DoJit(em_address, b);
_assert_msg_(b->originalAddress == em_address, "original %08x != em_address %08x (block %d)", b->originalAddress, em_address, b->blockNum);
blocks.FinalizeBlock(block_num, jo.enableBlocklink);

EndWrite();
Expand Down Expand Up @@ -360,7 +361,8 @@ MIPSOpcode Jit::GetOffsetInstruction(int offset) {

const u8 *Jit::DoJit(u32 em_address, JitBlock *b) {
js.cancel = false;
js.blockStart = js.compilerPC = mips_->pc;
js.blockStart = em_address;
js.compilerPC = em_address;
js.lastContinuedPC = 0;
js.initialBlockSize = 0;
js.nextExit = 0;
Expand Down

0 comments on commit 8a90e94

Please sign in to comment.