dxx-rebirth/common/arch
Kp 32daf8e8c3 Handle unaligned stack during Win32 hexdump logging
The dump logger probes for the end of the stack, then rounds down to the
nearest paragraph boundary to simplify the logic in the hexdump routine.
The termination condition in the hexdump code assumed that there would
exist an integer N such that (`start` + (16 * N) == `end`).  Since `end`
is rounded to a multiple of 16, this held if and only if `start` is also
a multiple of 16.  In practice, this tended to happen, but it was not
guaranteed by the code.  If it ever failed to happen, then the hexdump
routine would not terminate and would instead perform an invalid read
beyond the edge of the stack.

Modify the hexdump routine to round `start` to a multiple of 16 so that
the termination condition works as intended.  This has the useful side
effect that hex dumps now always start paragraph aligned.  When the
stack was not paragraph aligned, this change will cause the hexdump to
show bytes below the stack pointer at the time of the fault.  However,
the stack requirements of the handler itself ensure that these bytes
will be valid.
2017-06-03 17:11:12 +00:00
..
carbon Fix prototype of Mac msgbox_warning 2014-11-30 17:03:54 +00:00
cocoa Uninline namespace dcx 2015-12-13 18:00:49 +00:00
ogl Move ogl_sync fence into local scope for before_swap 2017-04-08 16:48:19 +00:00
sdl Fix memory corruption starting multiplayer game 2016-11-19 18:09:26 +00:00
win32 Handle unaligned stack during Win32 hexdump logging 2017-06-03 17:11:12 +00:00