aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-10-11 13:23:47 +0000
committerTorbjörn Andersson2005-10-11 13:23:47 +0000
commitb7e62ffb1816b339c2159708c2b97a8e5af25b33 (patch)
tree8e1acb2d557a43a6143a7ac73a67f70a98a55c90 /saga
parent049dd317d70e89843df12e2d1d859ea850c600ae (diff)
downloadscummvm-rg350-b7e62ffb1816b339c2159708c2b97a8e5af25b33.tar.gz
scummvm-rg350-b7e62ffb1816b339c2159708c2b97a8e5af25b33.tar.bz2
scummvm-rg350-b7e62ffb1816b339c2159708c2b97a8e5af25b33.zip
Fix stack underflow when Gorrister examines the mirror in IHNM. opReturnV
was popping *twice* the number of parameters that had originally been pushed. This appears to have been a bug in the ITE floppy version as well; one that was fixed in the CD version. At least that's how I understand it. svn-id: r19017
Diffstat (limited to 'saga')
-rw-r--r--saga/sthread.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/saga/sthread.cpp b/saga/sthread.cpp
index 1c4e0badb9..58db4d24ed 100644
--- a/saga/sthread.cpp
+++ b/saga/sthread.cpp
@@ -308,7 +308,7 @@ bool Script::runThread(ScriptThread *thread, uint instructionLimit) {
addr = thread->baseAddress(scriptS.readByte());
iparam1 = scriptS.readSint16LE();
addr += iparam1;
- *(uint16*)addr = thread->pop();
+ *(uint16*)addr = thread->pop();
break;
// FUNCTION CALL INSTRUCTIONS
@@ -380,8 +380,9 @@ bool Script::runThread(ScriptThread *thread, uint instructionLimit) {
} else {
thread->pop(); //cause it 0
thread->_instructionOffset = thread->pop();
+
+ // Pop all the call parameters off the stack
iparam1 = thread->pop();
- iparam1 += iparam1;
while (iparam1--) {
thread->pop();
}