- fixed missing null checks in JIT generated code

https://forum.zdoom.org/viewtopic.php?t=64307
This commit is contained in:
alexey.lysiuk 2019-04-27 17:05:36 +03:00
parent dd7ec1fe44
commit 3767a9aec1

View file

@ -89,6 +89,7 @@ void JitCompiler::EmitSS_R()
void JitCompiler::EmitSO() void JitCompiler::EmitSO()
{ {
EmitNullPointerThrow(A, X_WRITE_NIL);
cc.mov(asmjit::x86::ptr(regA[A], konstd[C]), regA[B]); cc.mov(asmjit::x86::ptr(regA[A], konstd[C]), regA[B]);
typedef void(*FuncPtr)(DObject*); typedef void(*FuncPtr)(DObject*);
@ -98,6 +99,7 @@ void JitCompiler::EmitSO()
void JitCompiler::EmitSO_R() void JitCompiler::EmitSO_R()
{ {
EmitNullPointerThrow(A, X_WRITE_NIL);
cc.mov(asmjit::x86::ptr(regA[A], regD[C]), regA[B]); cc.mov(asmjit::x86::ptr(regA[A], regD[C]), regA[B]);
typedef void(*FuncPtr)(DObject*); typedef void(*FuncPtr)(DObject*);
@ -107,11 +109,13 @@ void JitCompiler::EmitSO_R()
void JitCompiler::EmitSP() void JitCompiler::EmitSP()
{ {
EmitNullPointerThrow(A, X_WRITE_NIL);
cc.mov(asmjit::x86::ptr(regA[A], konstd[C]), regA[B]); cc.mov(asmjit::x86::ptr(regA[A], konstd[C]), regA[B]);
} }
void JitCompiler::EmitSP_R() void JitCompiler::EmitSP_R()
{ {
EmitNullPointerThrow(A, X_WRITE_NIL);
cc.mov(asmjit::x86::ptr(regA[A], regD[C]), regA[B]); cc.mov(asmjit::x86::ptr(regA[A], regD[C]), regA[B]);
} }