From 954451fbfa00f8dfd496d01045aed7cfaa0b6774 Mon Sep 17 00:00:00 2001 From: Patrick Mackinlay Date: Thu, 18 Jun 2020 18:26:21 +0700 Subject: [PATCH] asmjit: sync with upstream (nw) --- 3rdparty/asmjit/src/asmjit/core/compiler.cpp | 2 +- 3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/3rdparty/asmjit/src/asmjit/core/compiler.cpp b/3rdparty/asmjit/src/asmjit/core/compiler.cpp index 251a6ff2a3e..8043b48c847 100644 --- a/3rdparty/asmjit/src/asmjit/core/compiler.cpp +++ b/3rdparty/asmjit/src/asmjit/core/compiler.cpp @@ -533,6 +533,7 @@ Error BaseCompiler::newJumpNode(JumpNode** out, uint32_t instId, uint32_t instOp JumpNode* node = _allocator.allocT(); uint32_t opCount = 1; + *out = node; if (ASMJIT_UNLIKELY(!node)) return reportError(DebugUtils::errored(kErrorOutOfMemory)); @@ -540,7 +541,6 @@ Error BaseCompiler::newJumpNode(JumpNode** out, uint32_t instId, uint32_t instOp node->setOp(0, o0); node->resetOpRange(opCount, JumpNode::kBaseOpCapacity); - *out = node; return kErrorOk; } diff --git a/3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp b/3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp index 82f782e0fc6..2dfd25fc4a6 100644 --- a/3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp +++ b/3rdparty/asmjit/src/asmjit/x86/x86instapi.cpp @@ -377,7 +377,7 @@ ASMJIT_FAVOR_SIZE Error InstInternal::validate(uint32_t arch, const BaseInst& in memSize <<= m.getBroadcast(); } - if (baseType) { + if (baseType != 0 && baseType > Label::kLabelTag) { uint32_t baseId = m.baseId(); if (m.isRegHome()) { @@ -412,6 +412,9 @@ ASMJIT_FAVOR_SIZE Error InstInternal::validate(uint32_t arch, const BaseInst& in if (!indexType && !m.offsetLo32()) memFlags |= InstDB::kMemOpBaseOnly; } + else if (baseType == Label::kLabelTag) { + // [Label] - there is no need to validate the base as it's label. + } else { // Base is a 64-bit address. int64_t offset = m.offset();