diff options
author | Willem Jan Palenstijn | 2009-05-28 22:42:18 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2009-05-28 22:42:18 +0000 |
commit | 67fa1fb59cea20ffe53b20a9ba6b8ea594199c8a (patch) | |
tree | 133a5fbc5644e7783185395a7751a4750dcfafd5 /engines/sci/engine/gc.cpp | |
parent | d25ddb5fa92aa7a671392dac01505d525c6b112a (diff) | |
download | scummvm-rg350-67fa1fb59cea20ffe53b20a9ba6b8ea594199c8a.tar.gz scummvm-rg350-67fa1fb59cea20ffe53b20a9ba6b8ea594199c8a.tar.bz2 scummvm-rg350-67fa1fb59cea20ffe53b20a9ba6b8ea594199c8a.zip |
SCI: Fix potential dangling pointer more robustly,
by changing the executionStack implementation to a list.
svn-id: r40971
Diffstat (limited to 'engines/sci/engine/gc.cpp')
-rw-r--r-- | engines/sci/engine/gc.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index 5bc8fc38d7..b5f49fbccf 100644 --- a/engines/sci/engine/gc.cpp +++ b/engines/sci/engine/gc.cpp @@ -97,8 +97,10 @@ reg_t_hash_map *find_all_used_references(EngineState *s) { #endif // Init: Execution Stack - for (i = 0; i < s->_executionStack.size(); i++) { - ExecStack &es = s->_executionStack[i]; + Common::List<ExecStack>::iterator iter; + for (iter = s->_executionStack.begin(); + iter != s->_executionStack.end(); ++iter) { + ExecStack &es = *iter; if (es.type != EXEC_STACK_TYPE_KERNEL) { wm.push(es.objp); |