From 135aec7beab9e484183565eea9d3cab03fe0b879 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 17 Mar 2016 19:51:43 -0400 Subject: [PATCH] shader_jit_x64: Fix strict memory aliasing issues. --- src/video_core/shader/shader_jit_x64.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index dffe051ef..d74b58d84 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp @@ -741,7 +741,9 @@ void JitCompiler::Compile_Block(unsigned end) { void JitCompiler::Compile_NextInstr(unsigned* offset) { offset_ptr = offset; - Instruction instr = *(Instruction*)&g_state.vs.program_code[(*offset_ptr)++]; + Instruction instr; + std::memcpy(&instr, &g_state.vs.program_code[(*offset_ptr)++], sizeof(Instruction)); + OpCode::Id opcode = instr.opcode.Value(); auto instr_func = instr_table[static_cast(opcode)];