From 00f9e5fe50cdba33729e32bf91b6c2549e41533c Mon Sep 17 00:00:00 2001 From: kobalicekp Date: Sat, 3 May 2014 10:59:52 +0200 Subject: [PATCH] 64-bit GP register/variable is now forbidden in 32-bit mode. (Issue #26). --- src/asmjit/x86/x86compiler.cpp | 4 +++- src/asmjit/x86/x86defs.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/asmjit/x86/x86compiler.cpp b/src/asmjit/x86/x86compiler.cpp index c70f3e5..039834b 100644 --- a/src/asmjit/x86/x86compiler.cpp +++ b/src/asmjit/x86/x86compiler.cpp @@ -507,9 +507,11 @@ Error X86X64Compiler::_newVar(BaseVar* var, uint32_t vType, const char* name) { ASMJIT_ASSERT(vType < kVarTypeCount); vType = _targetVarMapping[vType]; - const VarInfo& vInfo = _varInfo[vType]; + ASMJIT_ASSERT(vType != kVarTypeInvalid); + const VarInfo& vInfo = _varInfo[vType]; VarData* vd = _newVd(vType, vInfo.getSize(), vInfo.getClass(), name); + if (vd == NULL) { static_cast(var)->reset(); return getError(); diff --git a/src/asmjit/x86/x86defs.cpp b/src/asmjit/x86/x86defs.cpp index 22e5945..009c4d6 100644 --- a/src/asmjit/x86/x86defs.cpp +++ b/src/asmjit/x86/x86defs.cpp @@ -3191,8 +3191,8 @@ const uint8_t _varMapping[kVarTypeCount] = { /* 03: kVarTypeUInt16 */ kVarTypeUInt16, /* 04: kVarTypeInt32 */ kVarTypeInt32, /* 05: kVarTypeUInt32 */ kVarTypeUInt32, - /* 06: kVarTypeInt64 */ kVarTypeInt32, // Remapped (Invalid in 32-bit mode). - /* 07: kVarTypeUInt64 */ kVarTypeUInt32, // Remapped (Invalid in 32-bit mode). + /* 06: kVarTypeInt64 */ kVarTypeInvalid, // Invalid in 32-bit mode. + /* 07: kVarTypeUInt64 */ kVarTypeInvalid, // Invalid in 32-bit mode. /* 08: kVarTypeIntPtr */ kVarTypeInt32, // Remapped. /* 09: kVarTypeUIntPtr */ kVarTypeUInt32, // Remapped. /* 10: kVarTypeFp32 */ kVarTypeFp32,