* tcgx86_64.g_proc_entry: Don't crash if 'list' is initially empty. Went unnoticed this far because ncgutil.gen_proc_entry_code adds some items before calling cg.g_proc_entry.

git-svn-id: trunk@32670 -
This commit is contained in:
sergei 2015-12-16 11:13:24 +00:00
parent 2248805082
commit eb86cd47c6

View File

@ -168,6 +168,7 @@ unit cgcpu;
procedure tcgx86_64.g_proc_entry(list : TAsmList;localsize:longint;nostackframe:boolean);
var
hitem: tlinkedlistitem;
seh_proc: tai_seh_directive;
r: integer;
href: treference;
templist: TAsmList;
@ -291,7 +292,11 @@ unit cgcpu;
if not (pi_has_unwind_info in current_procinfo.flags) then
exit;
{ Generate unwind data for x86_64-win64 }
list.insertafter(cai_seh_directive.create_name(ash_proc,current_procinfo.procdef.mangledname),hitem);
seh_proc:=cai_seh_directive.create_name(ash_proc,current_procinfo.procdef.mangledname);
if assigned(hitem) then
list.insertafter(seh_proc,hitem)
else
list.insert(seh_proc);
templist:=TAsmList.Create;
{ We need to record postive offsets from RSP; if registers are saved