Correctly match ranges in memchecks with ends.

This commit is contained in:
Unknown W. Brackets 2013-07-05 01:13:05 -07:00
parent d2b874436d
commit 540bd13222
2 changed files with 6 additions and 6 deletions

View File

@ -248,12 +248,12 @@ MemCheck *CBreakPoints::GetMemCheck(u32 address, int size)
MemCheck &check = *iter;
if (check.end != 0)
{
if (address >= check.start && address + size < check.end)
if (address + size >= check.start && address < check.end)
return &check;
}
else
{
if (check.start==address)
if (check.start == address)
return &check;
}
}

View File

@ -732,7 +732,7 @@ void Jit::JitSafeMem::MemCheckImm(ReadType type)
jit_->CMP(32, M((void*)&coreState), Imm32(0));
skipChecks_.push_back(jit_->J_CC(CC_NE, true));
jit_->js.afterOp = JitState::AFTER_CORE_STATE | JitState::AFTER_REWIND_PC_BAD_STATE;
jit_->js.afterOp |= JitState::AFTER_CORE_STATE | JitState::AFTER_REWIND_PC_BAD_STATE;
}
}
@ -749,9 +749,9 @@ void Jit::JitSafeMem::MemCheckAsm(ReadType type)
FixupBranch skipNext, skipNextRange;
if (it->end != 0)
{
jit_->CMP(32, R(xaddr_), Imm32(it->start - offset_));
jit_->CMP(32, R(xaddr_), Imm32(it->start - offset_ - size_));
skipNext = jit_->J_CC(CC_B);
jit_->CMP(32, R(xaddr_), Imm32(it->end - offset_ - size_));
jit_->CMP(32, R(xaddr_), Imm32(it->end - offset_));
skipNextRange = jit_->J_CC(CC_AE);
}
else
@ -768,7 +768,7 @@ void Jit::JitSafeMem::MemCheckAsm(ReadType type)
jit_->CMP(32, M((void*)&coreState), Imm32(0));
skipChecks_.push_back(jit_->J_CC(CC_NE, true));
jit_->js.afterOp = JitState::AFTER_CORE_STATE | JitState::AFTER_REWIND_PC_BAD_STATE;
jit_->js.afterOp |= JitState::AFTER_CORE_STATE | JitState::AFTER_REWIND_PC_BAD_STATE;
jit_->SetJumpTarget(skipNext);
if (it->end != 0)