From 4624c6e6a38ff209f09b1f1231cd0d8dd8e948a3 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 18 Nov 2018 12:48:50 +0200 Subject: [PATCH] - use custom offsetof() macro src/scripting/vm/jit_call.cpp:164:38: warning: offset of on non-standard-layout type 'VMScriptFunction' [-Winvalid-offsetof] src/scripting/vm/jit_load.cpp:87:50: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof] src/scripting/vm/jit_load.cpp:96:50: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof] src/scripting/vm/jit_load.cpp:257:53: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof] --- src/scripting/vm/jit_call.cpp | 2 +- src/scripting/vm/jit_load.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/scripting/vm/jit_call.cpp b/src/scripting/vm/jit_call.cpp index 15dc8b56e..0c2d8115b 100644 --- a/src/scripting/vm/jit_call.cpp +++ b/src/scripting/vm/jit_call.cpp @@ -161,7 +161,7 @@ void JitCompiler::EmitScriptCall(asmjit::X86Gp vmfunc, asmjit::X86Gp paramsptr) using namespace asmjit; auto scriptcall = newTempIntPtr(); - cc.mov(scriptcall, x86::ptr(vmfunc, offsetof(VMScriptFunction, ScriptCall))); + cc.mov(scriptcall, x86::ptr(vmfunc, myoffsetof(VMScriptFunction, ScriptCall))); auto result = newResultInt32(); auto call = cc.call(scriptcall, FuncSignature5()); diff --git a/src/scripting/vm/jit_load.cpp b/src/scripting/vm/jit_load.cpp index 908ff144e..ab6dd24c9 100644 --- a/src/scripting/vm/jit_load.cpp +++ b/src/scripting/vm/jit_load.cpp @@ -84,8 +84,8 @@ void JitCompiler::EmitMETA() cc.test(regA[B], regA[B]); cc.je(label); - cc.mov(regA[A], asmjit::x86::qword_ptr(regA[B], offsetof(DObject, Class))); - cc.mov(regA[A], asmjit::x86::qword_ptr(regA[A], offsetof(PClass, Meta))); + cc.mov(regA[A], asmjit::x86::qword_ptr(regA[B], myoffsetof(DObject, Class))); + cc.mov(regA[A], asmjit::x86::qword_ptr(regA[A], myoffsetof(PClass, Meta))); } void JitCompiler::EmitCLSS() @@ -93,7 +93,7 @@ void JitCompiler::EmitCLSS() auto label = EmitThrowExceptionLabel(X_READ_NIL); cc.test(regA[B], regA[B]); cc.je(label); - cc.mov(regA[A], asmjit::x86::qword_ptr(regA[B], offsetof(DObject, Class))); + cc.mov(regA[A], asmjit::x86::qword_ptr(regA[B], myoffsetof(DObject, Class))); } #else @@ -254,7 +254,7 @@ void JitCompiler::EmitReadBarrier() cc.je(isnull); auto mask = newTempIntPtr(); - cc.mov(mask.r32(), asmjit::x86::dword_ptr(regA[A], offsetof(DObject, ObjectFlags))); + cc.mov(mask.r32(), asmjit::x86::dword_ptr(regA[A], myoffsetof(DObject, ObjectFlags))); cc.shl(mask, 63 - 5); // put OF_EuthanizeMe (1 << 5) in the highest bit cc.sar(mask, 63); // sign extend so all bits are set if OF_EuthanizeMe was set cc.not_(mask);