* on aarch64-win64 do the assignment of the exception frame pointer only after the SEH prologue has been done as there is no SEH directive for assigning a register to FP

This commit is contained in:
Sven/Sarah Barth 2024-11-08 18:17:12 +01:00
parent b7afb6237f
commit 465537583b

View File

@ -1889,6 +1889,7 @@ implementation
hitem: tlinkedlistitem; hitem: tlinkedlistitem;
seh_proc: tai_seh_directive; seh_proc: tai_seh_directive;
templist: TAsmList; templist: TAsmList;
genloadframeforexcept,
suppress_endprologue: boolean; suppress_endprologue: boolean;
ref: treference; ref: treference;
totalstackframesize: longint; totalstackframesize: longint;
@ -1905,6 +1906,7 @@ implementation
SEH directives in assembler body. In this case, .seh_endprologue SEH directives in assembler body. In this case, .seh_endprologue
is expected to be one of those directives, and not generated here. } is expected to be one of those directives, and not generated here. }
suppress_endprologue:=(pi_has_unwind_info in current_procinfo.flags); suppress_endprologue:=(pi_has_unwind_info in current_procinfo.flags);
genloadframeforexcept:=false;
if not nostackframe then if not nostackframe then
begin begin
@ -1934,7 +1936,12 @@ implementation
end end
else else
begin begin
gen_load_frame_for_exceptfilter(list); { do this after the prologue is done for aarch64-win64 as
there is no SEH directive for setting FP to a register }
if target_info.system<>system_aarch64_win64 then
gen_load_frame_for_exceptfilter(list)
else
genloadframeforexcept:=true;
localsize:=current_procinfo.maxpushedparasize; localsize:=current_procinfo.maxpushedparasize;
end; end;
end; end;
@ -1994,7 +2001,11 @@ implementation
end; end;
if not (pi_has_unwind_info in current_procinfo.flags) then if not (pi_has_unwind_info in current_procinfo.flags) then
begin
if genloadframeforexcept then
gen_load_frame_for_exceptfilter(list);
exit; exit;
end;
{ Generate unwind data for aarch64-win64 } { Generate unwind data for aarch64-win64 }
seh_proc:=cai_seh_directive.create_name(ash_proc,current_procinfo.procdef.mangledname); seh_proc:=cai_seh_directive.create_name(ash_proc,current_procinfo.procdef.mangledname);
@ -2015,6 +2026,9 @@ implementation
else else
list.concatlist(templist); list.concatlist(templist);
templist.free; templist.free;
if genloadframeforexcept then
gen_load_frame_for_exceptfilter(list);
end; end;