diff --git a/src/backend_x64/interface_x64.cpp b/src/backend_x64/interface_x64.cpp index e6baf808..c770a601 100644 --- a/src/backend_x64/interface_x64.cpp +++ b/src/backend_x64/interface_x64.cpp @@ -32,7 +32,7 @@ using namespace BackendX64; struct Jit::Impl { Impl(Jit* jit, UserCallbacks callbacks) : block_of_code() - , jit_state(&block_of_code) + , jit_state() , emitter(&block_of_code, callbacks, jit) , callbacks(callbacks) {} @@ -127,12 +127,12 @@ void Jit::ClearCache(bool poison_memory) { ASSERT(!is_executing); impl->block_of_code.ClearCache(poison_memory); impl->emitter.ClearCache(); - impl->jit_state.ResetRSB(&impl->block_of_code); + impl->jit_state.ResetRSB(); } void Jit::Reset() { ASSERT(!is_executing); - impl->jit_state = JitState(&impl->block_of_code); + impl->jit_state = {}; } void Jit::HaltExecution() { diff --git a/src/backend_x64/jitstate.cpp b/src/backend_x64/jitstate.cpp index 92b7d957..f0e49352 100644 --- a/src/backend_x64/jitstate.cpp +++ b/src/backend_x64/jitstate.cpp @@ -14,8 +14,9 @@ namespace Dynarmic { namespace BackendX64 { -void JitState::ResetRSB(const BlockOfCode* code) { - rsb_codeptrs.fill(reinterpret_cast(code->GetReturnFromRunCodeAddress())); +void JitState::ResetRSB() { + rsb_location_descriptors.fill(0xFFFFFFFFFFFFFFFFull); + rsb_codeptrs.fill(0); } /** diff --git a/src/backend_x64/jitstate.h b/src/backend_x64/jitstate.h index 48ee9902..38a8c0be 100644 --- a/src/backend_x64/jitstate.h +++ b/src/backend_x64/jitstate.h @@ -18,7 +18,7 @@ class BlockOfCode; constexpr size_t SpillCount = 64; struct JitState { - explicit JitState(const BlockOfCode* code) { ResetRSB(code); } + JitState() { ResetRSB(); } u32 Cpsr = 0; std::array Reg{}; // Current register file. @@ -43,7 +43,7 @@ struct JitState { u32 rsb_ptr = 0; std::array rsb_location_descriptors; std::array rsb_codeptrs; - void ResetRSB(const BlockOfCode* code); + void ResetRSB(); u32 FPSCR_IDC = 0; u32 FPSCR_UFC = 0;