winebuild: Conditionally use different code for restoring the context structure.

Sebastian Lackner sebastian at fds-team.de
Sun Mar 1 18:59:00 CST 2015


Fixes a regression introduced by 44fbc018eda12bdee5c2c1e2e40dbdc6a81b27fd.
See for example: https://bugs.winehq.org/show_bug.cgi?id=26344#c9

The previous code was not completely correct for the situation when switching
back to a 16-bit stack. If ESP contains garbage in the high word, then accessing
the memory on the target stack fails. We could theoretically use only the lower
16-bits for accessing the memory, but there is no good way to determine if a
segment if 16- or 32-bit. To ensure that the original issue stays fixed this
patch adds a check, to decide at runtime if we can safely copy values on the target
stack or not. If not then we use again the "old" method of restoring the thread
context.

---
 tools/winebuild/relay.c | 57 +++++++++++++++++++++++++++++++++++--------------
 1 file changed, 41 insertions(+), 16 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-winebuild-Conditionally-use-different-code-for-resto.patch
Type: text/x-patch
Size: 4255 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150302/c546c4ef/attachment.bin>


More information about the wine-patches mailing list