From abc01fd3773b8928c18159fde4b416383779a422 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Sat, 3 Feb 2018 00:32:22 -0500 Subject: [PATCH] Fix Torque3D 64bit DSOs. Fix from Torque2D for 64bit string table entries. --- Engine/source/console/codeBlock.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 3f5c3f292..f8f814f5b 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -409,6 +409,8 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st) U32 totSize = codeLength + lineBreakPairCount * 2; code = new U32[totSize]; + // 0xFF is used as a flag to help compress the bytecode. + // If detected, the bytecode is only a U8. for (i = 0; i < codeLength; i++) { U8 b; @@ -442,7 +444,11 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st) { U32 ip; st.read(&ip); +#ifdef TORQUE_CPU_X64 + *(U64*)(code + ip) = (U64)ste; +#else code[ip] = *((U32 *)&ste); +#endif } }