diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-12-16 22:09:43 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-12-16 22:09:43 +0400 |
commit | 6eee66418c285caaf32187332f9e9fb0d7c008ab (patch) | |
tree | c017d416b6efb6aef5c1b1c1884afd1f4a69a323 /winsup/cygwin/dcrt0.cc | |
parent | 56d06b9af37e33ebb03914c5452cb765352b4c03 (diff) |
* dcrt0.cc (child_info_fork::alloc_stack): Correctly check if the
parent stack fits into the child stack. Align comment.
* wow64.cc (wow64_eval_expected_main_stack): New function to fetch
expected addresses of main thread stack from PE/COFF image header
values.
(wow64_test_for_64bit_parent): Fix comment. Check current stack
against real expected main thread stack addresses.
(wow64_revert_to_original_stack): Fix and add comments. Check memory
against real expected main thread stack addresses. Use orignal stack
if reserved area is >= 256K.
Diffstat (limited to 'winsup/cygwin/dcrt0.cc')
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index a3900372d..fe6d62e57 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -452,10 +452,12 @@ child_info_fork::alloc_stack () parent. In that case the _tlsbase of the forked child is not the same as the _tlsbase of the parent (== stackbottom), but only because the stack of the parent has been slightly rearranged. See comment in - wow64_revert_to_original_stack for details. We just check here if the - stack is in the usual range for the main thread stack. */ + wow64_revert_to_original_stack for details. We check here if the + parent stack fits into the child stack. */ if (_tlsbase != stackbottom - && (!wincap.is_wow64 () || stackbottom > (char *) 0x400000)) + && (!wincap.is_wow64 () + || stacktop < (char *) NtCurrentTeb ()->DeallocationStack + || stackbottom > _tlsbase)) alloc_stack_hard_way (esp); else { |