mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
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
This commit is contained in:
parent
e55686590e
commit
8ff6a709fb
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user