From 7c5da821d4516cc0be69709dc6290a034eb701af Mon Sep 17 00:00:00 2001 From: Gliniak Date: Thu, 8 Dec 2022 21:48:13 +0100 Subject: [PATCH] [Kernel] Fixed invalid thread pointer in KeEnableFpuExceptions --- src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc index 1ca764d82..0db0c7b56 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_misc.cc @@ -24,7 +24,8 @@ void KeEnableFpuExceptions_entry( // TODO(benvanik): can we do anything about exceptions? // theres a lot more thats supposed to happen here, the floating point state has to be saved to kthread, the irql changes, the machine state register is changed to enable exceptions - X_KTHREAD* kthread = ctx->TranslateVirtualGPR(ctx->r[13]); + X_KTHREAD* kthread = ctx->TranslateVirtual( + ctx->TranslateVirtualGPR(ctx->r[13])->current_thread); kthread->fpu_exceptions_on = static_cast(ctx->r[3]) != 0; } DECLARE_XBOXKRNL_EXPORT1(KeEnableFpuExceptions, kNone, kStub);