Skip to content

Commit 7ef781d

Browse files
authored
Merge pull request GarageGames#2187 from JeffProgrammer/torquescript_64_dsos
Fix Torque3D 64bit DSOs.
2 parents 0191bf5 + d8e302e commit 7ef781d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Engine/source/console/codeBlock.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,8 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st)
409409
U32 totSize = codeLength + lineBreakPairCount * 2;
410410
code = new U32[totSize];
411411

412+
// 0xFF is used as a flag to help compress the bytecode.
413+
// If detected, the bytecode is only a U8.
412414
for (i = 0; i < codeLength; i++)
413415
{
414416
U8 b;
@@ -442,7 +444,11 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st)
442444
{
443445
U32 ip;
444446
st.read(&ip);
447+
#ifdef TORQUE_CPU_X64
448+
*(U64*)(code + ip) = (U64)ste;
449+
#else
445450
code[ip] = *((U32 *)&ste);
451+
#endif
446452
}
447453
}
448454

0 commit comments

Comments
 (0)