aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormd52011-05-13 00:15:41 +0300
committermd52011-05-13 00:15:41 +0300
commitc9cef5e9711a33c5e8a0a442b336175df5ebb3c2 (patch)
treed6b30e605381d2f9fe8f9e2cec4bf07bce85626e
parenta3c6439a1a464471b62b091d52065cf53a8dabdf (diff)
downloadscummvm-rg350-c9cef5e9711a33c5e8a0a442b336175df5ebb3c2.tar.gz
scummvm-rg350-c9cef5e9711a33c5e8a0a442b336175df5ebb3c2.tar.bz2
scummvm-rg350-c9cef5e9711a33c5e8a0a442b336175df5ebb3c2.zip
SCI: Marked the sanity check inside processWorkList() as a workaround
The sanity check added in rev #35086fe17c fixes the crashes with that code when an invalid reference is about to be processed, but these references shouldn't be in the stack at all in the first place, so the root cause seems to be somewhere else.
-rw-r--r--engines/sci/engine/gc.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp
index 9c580dd8dc..b40677d4ed 100644
--- a/engines/sci/engine/gc.cpp
+++ b/engines/sci/engine/gc.cpp
@@ -87,7 +87,13 @@ static void processWorkList(SegManager *segMan, WorklistManager &wm, const Commo
wm._worklist.pop_back();
if (reg.segment != stackSegment) { // No need to repeat this one
debugC(kDebugLevelGC, "[GC] Checking %04x:%04x", PRINT_REG(reg));
- // We only check for valid offsets here. Fixes bugs #3299458 and #3295849.
+ // WORKAROUND: We only check for valid offsets here. Fixes bugs
+ // #3299458 and #3295849.
+ // FIXME: Where are these invalid offsets coming from? The check
+ // below avoids a crash when examining invalid references, but the
+ // root of the problem lies elsewhere. These shouldn't be in the
+ // stack at all (unless these really are script bugs, in which case
+ // we should just keep the sanity check).
if (reg.segment < heap.size() && heap[reg.segment] && heap[reg.segment]->isValidOffset(reg.offset)) {
// Valid heap object? Find its outgoing references!
wm.pushArray(heap[reg.segment]->listAllOutgoingReferences(reg));