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. |
||
---|---|---|
.. | ||
carbon | ||
cocoa | ||
ogl | ||
sdl | ||
win32 |