+ Win32 SEH: actually install the exception handler around main procedure (write to fs:(0) was missing).

git-svn-id: trunk@26239 -
This commit is contained in:
sergei 2013-12-16 13:25:44 +00:00
parent 74f9d719f1
commit 695f271b8c

View File

@ -225,14 +225,15 @@ procedure Exe_entry(const info : TEntryInformation);[public,alias:'_FPC_EXE_Entr
point to anything yet
this will be used in signals unit }
leal xframe,%eax
movl %fs:(0),%ecx
movl %ecx,TException_Frame.next(%eax)
movl %eax,System_exception_frame
{$ifndef FPC_USE_WIN32_SEH}
movl $0,TException_Frame.handler(%eax)
{$else}
movl $OutermostHandler,TException_Frame.handler(%eax)
movl %eax,%fs:(0)
{$endif FPC_USE_WIN32_SEH}
movl %fs:(0),%ecx
movl %ecx,TException_Frame.next(%eax)
movl %eax,System_exception_frame
pushl %ebp
xorl %eax,%eax
movw %ss,%ax