Skip to content

Commit 80964a8

Browse files
committed
[[ LCB ]] Fix incorrect module version calculation.
1 parent eb01b7b commit 80964a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libscript/src/script-builder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ bool MCScriptEndModule(MCScriptModuleBuilderRef self, MCStreamRef p_stream)
148148
byte_t t_header[4];
149149
t_header[0] = 'L';
150150
t_header[1] = 'C';
151-
t_header[2] = ((kMCScriptCurrentModuleVersion & 0xFF) >> 0);
152-
t_header[3] = ((kMCScriptCurrentModuleVersion & 0xFF) >> 8);
151+
t_header[2] = ((kMCScriptCurrentModuleVersion >> 0) & 0xFF);
152+
t_header[3] = ((kMCScriptCurrentModuleVersion >> 8) & 0xFF);
153153

154154
t_success = MCStreamWrite(p_stream, t_header, 4) &&
155155
MCScriptWriteRawModule(p_stream, &self -> module);

libscript/src/script-module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ bool MCScriptCreateModuleFromStream(MCStreamRef stream, MCScriptModuleRef& r_mod
462462

463463
// If this fails, then it is a potentially a LiveCode module, but in a format
464464
// we do not support.
465-
if (t_header[2] != (kMCScriptCurrentModuleVersion & 0xFF) ||
465+
if (t_header[2] != ((kMCScriptCurrentModuleVersion >> 0) & 0xFF) ||
466466
t_header[3] != ((kMCScriptCurrentModuleVersion >> 8) & 0xFF))
467467
return MCErrorThrowGeneric(MCSTR("module format not supported"));
468468

0 commit comments

Comments
 (0)