diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-02-13 09:42:22 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-02-13 09:42:22 +0000 |
commit | 5cb998e66c8a342dad9ea03fcb5126f12ec50156 (patch) | |
tree | a5ae719b8e10a5ac8cb4537b0a20dc28d557ed7b /winsup/cygwin/exceptions.cc | |
parent | 9cb5dea0e22c3fdde4f0c638b052a0186587cf8f (diff) | |
download | cygnal-5cb998e66c8a342dad9ea03fcb5126f12ec50156.tar.gz cygnal-5cb998e66c8a342dad9ea03fcb5126f12ec50156.tar.bz2 cygnal-5cb998e66c8a342dad9ea03fcb5126f12ec50156.zip |
* cygtls.cc (_cygtls::init_exception_handler): Revert patch
from 2005-12-02.
* exceptions.cc (stack_info::walk): Add workaround for NT 5.2
64 bit OSes.
* wincap.h (wincaps::has_restricted_stack_args): New element.
* wincap.cc: Implement above element throughout.
(wincapc::init): Reset has_restricted_stack_args if not running
under WOW64.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index fc361b59b..05cc91696 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -245,9 +245,20 @@ stack_info::walk () sf.AddrReturn.Offset = (DWORD) *++ebp; if (needargs) - /* The arguments follow the return address */ - for (unsigned i = 0; i < NPARAMS; i++) - sf.Params[i] = (DWORD) *++ebp; + { + unsigned nparams = NPARAMS; + + /* The arguments follow the return address */ + sf.Params[0] = (DWORD) *++ebp; + /* Hack for XP/2K3 WOW64. If the first stack param points to the + application entry point, we can only fetch one additional + parameter. Accessing anything beyond this address results in + a SEGV. This is fixed in Vista/2K8 WOW64. */ + if (wincap.has_restricted_stack_args () && sf.Params[0] == 0x401000) + nparams = 2; + for (unsigned i = 0; i < nparams; i++) + sf.Params[i] = (DWORD) *++ebp; + } return 1; } |