diff options
author | Martin Kiewitz | 2010-06-25 16:04:37 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-06-25 16:04:37 +0000 |
commit | 8ff6a709fbe72bbd2d1ac53623558a2ed0e6c2a6 (patch) | |
tree | 7dcfe6e8c7489cead9ecedff7941f5eb39e74e73 /engines/sci/engine | |
parent | e55686590e2ca6a6e7eeca7a73def9dd3a0722c9 (diff) | |
download | scummvm-rg350-8ff6a709fbe72bbd2d1ac53623558a2ed0e6c2a6.tar.gz scummvm-rg350-8ff6a709fbe72bbd2d1ac53623558a2ed0e6c2a6.tar.bz2 scummvm-rg350-8ff6a709fbe72bbd2d1ac53623558a2ed0e6c2a6.zip |
SCI: when writing to a temp, check for segment 0xFFFF and remove it. This fixes a false-positive uninitialized read error in room 44 sq1
svn-id: r50269
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/vm.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index fa97dcf718..3295406745 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -273,6 +273,13 @@ static void validate_write_var(reg_t *r, reg_t *stack_base, int type, int max, i } } + // If we are writing an uninitialized value into a temp, we remove the uninitialized segment + // this happens at least in sq1/room 44 (slot-machine), because a send is missing parameters, then + // those parameters are taken from uninitialized stack and afterwards they are copied back into temps + // if we don't remove the segment, we would get false-positive uninitialized reads later + if (type == VAR_TEMP && value.segment == 0xffff) + value.segment = 0; + r[index] = value; } } |