aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-03-07 23:49:59 +0000
committerMax Horn2003-03-07 23:49:59 +0000
commitb484c7a6bc0d2093341c3dde99d28d3eacbda76c (patch)
tree7003c0f9e163cb997544d08cd8dbefb44dd4d53e /scumm
parent12d09b57b5c000fc32a5bf4a89572298c17aa417 (diff)
downloadscummvm-rg350-b484c7a6bc0d2093341c3dde99d28d3eacbda76c.tar.gz
scummvm-rg350-b484c7a6bc0d2093341c3dde99d28d3eacbda76c.tar.bz2
scummvm-rg350-b484c7a6bc0d2093341c3dde99d28d3eacbda76c.zip
added some code to get better valgrind results
svn-id: r6758
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp
index 6730ba1171..a6d226577f 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -467,8 +467,14 @@ void Scumm::setResult(int value) {
writeVar(_resultVarNumber, value);
}
+int my_dummy_global = 0;
+
void Scumm::push(int a) {
- assert(_scummStackPos >= 0 && (unsigned int)_scummStackPos <= ARRAYSIZE(_scummStack));
+// HACK to aid valgrind
+if (a > 0)
+ my_dummy_global++;
+
+ assert(_scummStackPos >= 0 && (unsigned int)_scummStackPos < ARRAYSIZE(_scummStack));
_scummStack[_scummStackPos++] = a;
}
@@ -477,7 +483,13 @@ int Scumm::pop() {
error("No items on stack to pop() for %s (0x%X) at [%d-%d]", getOpcodeDesc(_opcode), _opcode, _roomResource, vm.slot[_currentScript].number);
}
- return _scummStack[--_scummStackPos];
+ int a = _scummStack[--_scummStackPos];
+
+// HACK to aid valgrind
+if (a > 0)
+ my_dummy_global++;
+
+ return a;
}
void Scumm::drawBox(int x, int y, int x2, int y2, int color) {