1
0
Fork 0
forked from suyu/suyu

shader_jit_x64: Fix strict memory aliasing issues.

This commit is contained in:
bunnei 2016-03-17 19:51:43 -04:00
parent e5d417213c
commit 135aec7bea

View file

@ -741,7 +741,9 @@ void JitCompiler::Compile_Block(unsigned end) {
void JitCompiler::Compile_NextInstr(unsigned* offset) { void JitCompiler::Compile_NextInstr(unsigned* offset) {
offset_ptr = 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(); OpCode::Id opcode = instr.opcode.Value();
auto instr_func = instr_table[static_cast<unsigned>(opcode)]; auto instr_func = instr_table[static_cast<unsigned>(opcode)];