Permalink
Browse files

irjit: For debug, return the best block at addr.

Invalidation may result in multiple matching blocks, prefer any that is
currently valid.
  • Loading branch information...
unknownbrackets committed Jan 7, 2018
1 parent 463b2a9 commit cc8e9a93c32b4d49f304f75aeec27f355df49681
Showing with 6 additions and 2 deletions.
  1. +6 −2 Core/MIPS/IR/IRJit.cpp
View
@@ -405,14 +405,18 @@ int IRBlockCache::GetBlockNumberFromStartAddress(u32 em_address, bool realBlocks
return -1;
const std::vector<int> &blocksInPage = iter->second;
int best = -1;
for (int i : blocksInPage) {
uint32_t start, size;
blocks_[i].GetRange(start, size);
if (start == em_address) {
return i;
best = i;
if (blocks_[i].IsValid()) {
return i;
}
}
}
return -1;
return best;
}
bool IRBlock::HasOriginalFirstOp() const {

0 comments on commit cc8e9a9

Please sign in to comment.