From 91bbe56f59a32d95d744ad6a83bf1992452a248d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 30 Sep 2016 08:26:16 -0400 Subject: [PATCH] SystemRegisters: Get rid of pointer casting --- .../Interpreter/Interpreter_SystemRegisters.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp index 108aa9f77a..9e82f7e505 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_SystemRegisters.cpp @@ -3,6 +3,9 @@ // Refer to the license.txt file included. #include "Core/PowerPC/Interpreter/Interpreter.h" + +#include + #include "Common/Assert.h" #include "Common/CommonTypes.h" #include "Common/FPURoundMode.h" @@ -216,9 +219,12 @@ void Interpreter::mfspr(UGeckoInstruction _inst) case SPR_TL: case SPR_TU: - *((u64*)&TL) = - SystemTimers::GetFakeTimeBase(); // works since we are little endian and TL comes first :) - break; + { + // works since we are little endian and TL comes first :) + const u64 time_base = SystemTimers::GetFakeTimeBase(); + std::memcpy(&TL, &time_base, sizeof(u64)); + } + break; case SPR_WPAR: {