mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 22:28:10 +00:00
KYRA: (LOL) - fix stack access warning
This commit is contained in:
parent
d8004bebba
commit
e5b35d05e9
@ -61,11 +61,10 @@ struct EMCState {
|
||||
|
||||
#ifdef RELEASE_BUILD
|
||||
#define stackPos(x) (script->stack[script->sp+x])
|
||||
#define safeStackPos(x) (script->sp+x < EMCState::kStackSize ? stackPos(x) : 0)
|
||||
#else
|
||||
#define stackPos(x) emcSafeReadStack(script, x, __LINE__, __FILE__)
|
||||
#define safeStackPos(x) stackPos(x)
|
||||
#endif
|
||||
#define safeStackPos(x) (script->sp+x < EMCState::kStackSize ? stackPos(x) : 0)
|
||||
#define stackPosString(x) ((const char *)&script->dataPtr->text[READ_BE_UINT16(&script->dataPtr->text[stackPos(x)<<1])])
|
||||
|
||||
class Resource;
|
||||
|
@ -800,7 +800,7 @@ int LoLEngine::olol_copyRegion(EMCState *script) {
|
||||
|
||||
int LoLEngine::olol_initMonster(EMCState *script) {
|
||||
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_initMonster(%p) (%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)", (const void *)script,
|
||||
stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), stackPos(7), stackPos(8), stackPos(9), stackPos(10));
|
||||
stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5), stackPos(6), safeStackPos(7), safeStackPos(8), safeStackPos(9), safeStackPos(10));
|
||||
uint16 x = 0;
|
||||
uint16 y = 0;
|
||||
calcCoordinates(x, y, stackPos(0), stackPos(1), stackPos(2));
|
||||
@ -841,7 +841,7 @@ int LoLEngine::olol_initMonster(EMCState *script) {
|
||||
l->destDirection = l->direction;
|
||||
|
||||
for (int ii = 0; ii < 4; ii++)
|
||||
l->equipmentShapes[ii] = stackPos(7 + ii) & 0xFF;
|
||||
l->equipmentShapes[ii] = safeStackPos(7 + ii) & 0xFF;
|
||||
|
||||
checkSceneUpdateNeed(l->block);
|
||||
return i;
|
||||
|
Loading…
Reference in New Issue
Block a user