From 3f8f8d36d9e2803dc2741add6e56037774f6bdba Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 13 Aug 2023 18:01:05 -0700 Subject: [PATCH] riscv: Fix crash on clear icache. Oops, can't avoid marking all blocks invalid. Luckily a syscall should always take more bytes than the bail invalidated block code. --- Core/MIPS/IR/IRNativeCommon.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Core/MIPS/IR/IRNativeCommon.cpp b/Core/MIPS/IR/IRNativeCommon.cpp index 1483a29839..654ed5c16d 100644 --- a/Core/MIPS/IR/IRNativeCommon.cpp +++ b/Core/MIPS/IR/IRNativeCommon.cpp @@ -428,15 +428,9 @@ void IRNativeJit::InvalidateCacheAt(u32 em_address, int length) { std::vector numbers = blocks_.FindInvalidatedBlockNumbers(em_address, length); for (int block_num : numbers) { auto block = blocks_.GetBlock(block_num); - if (em_address != 0 || length < 0x1FFFFFFF) { - backend_->InvalidateBlock(block, block_num); - } + backend_->InvalidateBlock(block, block_num); block->Destroy(block->GetTargetOffset()); } - - if (em_address == 0 && length >= 0x1FFFFFFF) { - backend_->ClearAllBlocks(); - } } bool IRNativeJit::DescribeCodePtr(const u8 *ptr, std::string &name) {