diff options
author | Walter van Niftrik | 2010-02-06 19:41:55 +0000 |
---|---|---|
committer | Walter van Niftrik | 2010-02-06 19:41:55 +0000 |
commit | 1e67b56eee611a52f6c7fa9d3b5d17bda741c995 (patch) | |
tree | 5338dc4a23fee13053613024ee20bec870bd8603 /engines/sci/engine/gc.cpp | |
parent | 4cae2b13e2acbd81e4b726f1e409c5615eda7967 (diff) | |
download | scummvm-rg350-1e67b56eee611a52f6c7fa9d3b5d17bda741c995.tar.gz scummvm-rg350-1e67b56eee611a52f6c7fa9d3b5d17bda741c995.tar.bz2 scummvm-rg350-1e67b56eee611a52f6c7fa9d3b5d17bda741c995.zip |
SCI: Revert r47925 and put fix inside GC instead.
svn-id: r47940
Diffstat (limited to 'engines/sci/engine/gc.cpp')
-rw-r--r-- | engines/sci/engine/gc.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index bcc3ba34f6..c2f1c15776 100644 --- a/engines/sci/engine/gc.cpp +++ b/engines/sci/engine/gc.cpp @@ -76,14 +76,25 @@ reg_t_hash_map *find_all_used_references(EngineState *s) { WorklistManager wm; uint i; + assert(!s->_executionStack.empty()); + // Initialise // Init: Registers wm.push(s->r_acc); wm.push(s->r_prev); // Init: Value Stack // We do this one by hand since the stack doesn't know the current execution stack + Common::List<ExecStack>::iterator iter; { - ExecStack &xs = s->_executionStack.back(); + iter = s->_executionStack.reverse_begin(); + + // Skip fake kernel stack frame if it's on top + if (((*iter).type == EXEC_STACK_TYPE_KERNEL)) + --iter; + + assert((iter != s->_executionStack.end()) && ((*iter).type != EXEC_STACK_TYPE_KERNEL)); + + ExecStack &xs = *iter; reg_t *pos; for (pos = s->stack_base; pos < xs.sp; pos++) @@ -93,7 +104,6 @@ reg_t_hash_map *find_all_used_references(EngineState *s) { debugC(2, kDebugLevelGC, "[GC] -- Finished adding value stack"); // Init: Execution Stack - Common::List<ExecStack>::iterator iter; for (iter = s->_executionStack.begin(); iter != s->_executionStack.end(); ++iter) { ExecStack &es = *iter; |