win64 unwinding, misc fixes:

* Insert seh_endprologue directive after the last prologue instruction, not before it
* Omit seh_stackalloc for zero bytes
* (For now) ignore SEH directives in NASM and MASM writers, instead of failing with internal error.

git-svn-id: trunk@19246 -
This commit is contained in:
sergei 2011-09-26 13:55:21 +00:00
parent d94460e3b3
commit 4c21beb48e
4 changed files with 7 additions and 4 deletions

View File

@ -843,7 +843,8 @@ implementation
AsmWrite(tai_directive(hp).name^);
AsmLn;
end;
ait_seh_directive :
{ Ignore for now };
else
internalerror(10000);
end;

View File

@ -973,7 +973,8 @@ interface
end;
AsmLn;
end;
ait_seh_directive :
{ Ignore for now };
else
internalerror(10000);
end;

View File

@ -2209,7 +2209,8 @@ unit cgx86;
current_procinfo.final_localsize:=localsize;
if (target_info.system=system_x86_64_win64) then
begin
list.concat(cai_seh_directive.create_offset(ash_stackalloc,localsize));
if localsize<>0 then
list.concat(cai_seh_directive.create_offset(ash_stackalloc,localsize));
include(current_procinfo.flags,pi_has_unwind_info);
end;
end;

View File

@ -165,7 +165,7 @@ unit cgcpu;
end;
templist.concat(cai_seh_directive.create(ash_endprologue));
if assigned(current_procinfo.endprologue_ai) then
current_procinfo.aktproccode.insertlistbefore(current_procinfo.endprologue_ai,templist)
current_procinfo.aktproccode.insertlistafter(current_procinfo.endprologue_ai,templist)
else
list.concatlist(templist);
templist.free;