]> granicus.if.org Git - gc/commit
Fix GetThreadContext stale register values use if WoW64 (Win32)
authorHamayama <hamay1010@gmail.com>
Thu, 7 Feb 2019 21:51:25 +0000 (00:51 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 7 Feb 2019 21:51:25 +0000 (00:51 +0300)
commit9483d5bba805e8825dad2c54313304838fdac12f
tree9e6dbba0327c363eda8c7250e667b1d515f22d04
parenta29e39d93ce6379bdfc85b3b95c7b1fb396f1f93
Fix GetThreadContext stale register values use if WoW64 (Win32)

Issue #262 (bdwgc).

* misc.c [MSWIN32 && !MSWINRT_FLAVOR && !MSWIN_XBOX1]
(GC_win32_MessageBoxA): Do not define unless SMALL_CONFIG.
* misc.c [MSWIN32 && !_WIN64 && GC_WIN32_THREADS && CHECK_NOT_WOW64]
(GC_init): Do not call IsWow64Process() and GC_win32_MessageBoxA().
* win32_threads.c [I386] (isWow64): New static variable.
* win32_threads.c [I386] (GC_push_stack_for): If isWow64 then set also
CONTEXT_EXCEPTION_REQUEST and CONTEXT_SEGMENTS bits in ContextFlags;
if isWow64, and CONTEXT_EXCEPTION_REPORTING and
CONTEXT_EXCEPTION_ACTIVE are set on return from GetThreadContext then
call GetThreadSelectorEntry and use StackLimit of FS selector to set
sp local variable (instead of context.Esp); add comment.
* win32_threads.c [I386 && DEBUG_THREADS] (GC_push_stack_for): Call
GC_log_printf() to report TIB stack limit/base and the case when
CONTEXT_EXCEPTION_REQUEST is not supported.
* win32_threads.c [I386] (GC_thr_init): Set isWow64 by IsWow64Process()
if the later is available.
misc.c
win32_threads.c