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^); AsmWrite(tai_directive(hp).name^);
AsmLn; AsmLn;
end; end;
ait_seh_directive :
{ Ignore for now };
else else
internalerror(10000); internalerror(10000);
end; end;

View File

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

View File

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

View File

@ -165,7 +165,7 @@ unit cgcpu;
end; end;
templist.concat(cai_seh_directive.create(ash_endprologue)); templist.concat(cai_seh_directive.create(ash_endprologue));
if assigned(current_procinfo.endprologue_ai) then 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 else
list.concatlist(templist); list.concatlist(templist);
templist.free; templist.free;