diff options
author | Martin Kiewitz | 2010-10-07 14:40:11 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-10-07 14:40:11 +0000 |
commit | 2879e19b6a95917ea9c7b937ab31d9b7cac41693 (patch) | |
tree | 5769d57cb8823c890fb638d10d47a41e78dac1d1 /engines/sci | |
parent | 5ba3475f93013523f7ea3eec3ea30c89315029d4 (diff) | |
download | scummvm-rg350-2879e19b6a95917ea9c7b937ab31d9b7cac41693.tar.gz scummvm-rg350-2879e19b6a95917ea9c7b937ab31d9b7cac41693.tar.bz2 scummvm-rg350-2879e19b6a95917ea9c7b937ab31d9b7cac41693.zip |
SCI: unknown valgrind cases->fake 0 when official
we will fake 0 instead of error()ing out in official releases, when an uninitialized temp is read
is supposed to get backported
svn-id: r53046
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/vm.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index eaf6d2e126..a7f26419c8 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -207,10 +207,17 @@ static reg_t validate_read_var(reg_t *r, reg_t *stack_base, int type, int max, i // We need to find correct replacements for each situation manually SciTrackOriginReply originReply; SciWorkaroundSolution solution = trackOriginAndFindWorkaround(index, uninitializedReadWorkarounds, &originReply); - if (solution.type == WORKAROUND_NONE) + if (solution.type == WORKAROUND_NONE) { +#ifdef RELEASE_BUILD + // If we are running an official ScummVM release -> fake 0 in unknown cases + r[index] = NULL_REG; + break; +#else error("Uninitialized read for temp %d from method %s::%s (script %d, room %d, localCall %x)", index, originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, g_sci->getEngineState()->currentRoomNumber(), originReply.localCallOffset); +#endif + } assert(solution.type == WORKAROUND_FAKE); r[index] = make_reg(0, solution.value); break; |