- workaround pointer truncation bug in asmjit

This commit is contained in:
Magnus Norddahl 2018-12-09 17:36:43 +01:00
parent 40f77e5dac
commit f0ce453d47

View file

@ -169,16 +169,28 @@ void JitCompiler::EmitRET()
if (cc.is64Bit())
{
if (regtype & REGT_KONST)
cc.mov(x86::qword_ptr(location), asmjit::imm_ptr(konsta[regnum].v));
{
auto ptr = newTempIntPtr();
cc.mov(ptr, asmjit::imm_ptr(konsta[regnum].v));
cc.mov(x86::qword_ptr(location), ptr);
}
else
{
cc.mov(x86::qword_ptr(location), regA[regnum]);
}
}
else
{
if (regtype & REGT_KONST)
cc.mov(x86::dword_ptr(location), asmjit::imm_ptr(konsta[regnum].v));
{
auto ptr = newTempIntPtr();
cc.mov(ptr, asmjit::imm_ptr(konsta[regnum].v));
cc.mov(x86::dword_ptr(location), ptr);
}
else
{
cc.mov(x86::dword_ptr(location), regA[regnum]);
}
}
break;
}