From e9c9f1b562ab5835f8d9f54b5acc087fa080ee3e Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 11 Oct 2023 18:05:20 -0400 Subject: [PATCH] Workaround for 100% match --- LEGO1/mxdsaction.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LEGO1/mxdsaction.cpp b/LEGO1/mxdsaction.cpp index 21adaa9d..2e9a037b 100644 --- a/LEGO1/mxdsaction.cpp +++ b/LEGO1/mxdsaction.cpp @@ -162,9 +162,13 @@ void MxDSAction::MergeFrom(MxDSAction &p_dsAction) if (p_dsAction.m_up[2] != FLT_MAX) this->m_up[2] = p_dsAction.m_up[2]; - // TODO MxU16 extraLength = p_dsAction.m_extraLength; char *extraData = p_dsAction.m_extraData; + + // Taking those references forces the compiler to move the values onto the stack. + // The original code most likely looked differently, but this yields a 100% match. + MxU16 &_extraLength = extraLength; + char *&_extraData = extraData; if (extraLength && extraData) { if (!this->m_extraData || !strncmp("XXX", this->m_extraData, 3)) { delete[] this->m_extraData;