Merge pull request #17392 from hrydgard/misc-crash-fixes

Misc crash fixes from mystery thread
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2023-05-02 23:41:32 +02:00
commit 52b7bf502f
4 files changed
+9 -5

No files matched your search

+3 -2
View File
@@ -76,7 +76,7 @@ static uint64_t HashJitBlock(const JitBlock &b) {
}
JitBlockCache::JitBlockCache(MIPSState *mipsState, CodeBlockCommon *codeBlock) :
codeBlock_(codeBlock), blocks_(nullptr), num_blocks_(0) {
codeBlock_(codeBlock) {
}
JitBlockCache::~JitBlockCache() {
@@ -90,7 +90,8 @@ bool JitBlock::ContainsAddress(u32 em_address) {
}
bool JitBlockCache::IsFull() const {
return num_blocks_ >= MAX_NUM_BLOCKS - 1;
// -10 to safely leave space for some proxy blocks, which we don't check before we allocate (not ideal, but should work).
return num_blocks_ >= MAX_NUM_BLOCKS - 10;
}
void JitBlockCache::Init() {
+2 -2
View File
@@ -184,10 +184,10 @@ private:
MIPSOpcode GetEmuHackOpForBlock(int block_num) const;
CodeBlockCommon *codeBlock_;
JitBlock *blocks_;
JitBlock *blocks_ = nullptr;
std::unordered_multimap<u32, int> proxyBlockMap_;
int num_blocks_;
int num_blocks_ = 0;
std::unordered_multimap<u32, int> links_to_;
std::map<std::pair<u32,u32>, u32> block_map_; // (end_addr, start_addr) -> number