diff options
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 9b7c98049..e744e7c5d 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -243,21 +243,24 @@ stack_info::init (DWORD ebp, bool wantargs, bool goodframe) # undef debp } +extern "C" void _cygwin_exit_return (); + /* Walk the stack by looking at successive stored 'bp' frames. This is not foolproof. */ int stack_info::walk () { char **ebp; + + if ((void (*) ()) sf.AddrPC.Offset == _cygwin_exit_return) + return 0; /* stack frames are exhausted */ + if (((ebp = (char **) next_offset ()) == NULL) || (ebp >= (char **) cygwin_hmodule)) return 0; sf.AddrFrame.Offset = (DWORD) ebp; sf.AddrPC.Offset = sf.AddrReturn.Offset; - if (!sf.AddrPC.Offset) - return 0; /* stack frames are exhausted */ - /* The return address always follows the stack pointer */ sf.AddrReturn.Offset = (DWORD) *++ebp; |