Merge pull request #18190 from hrydgard/original-address-asserts

Add an assert to try to track down a mysterious reported crash.
This commit is contained in:
Henrik Rydgård 2023-09-21 12:26:23 +02:00 committed by GitHub
commit 50da8a91da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -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();
@ -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;

View File

@ -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!
@ -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;

View File

@ -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();
@ -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;