mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 18:07:56 +02:00
llvmpara: don't crash if a parameter has no paralocs
This commit is contained in:
parent
5ca8593f14
commit
b68512a969
@ -133,21 +133,23 @@ unit llvmpara;
|
||||
begin
|
||||
hp:=tparavarsym(paras[paranr]);
|
||||
paraloc:=hp.paraloc[side].location;
|
||||
if assigned(paraloc) and
|
||||
assigned(paraloc^.next) and
|
||||
(hp.paraloc[side].def.typ in [orddef,enumdef,floatdef]) then
|
||||
if assigned(paraloc) then
|
||||
begin
|
||||
if not(paraloc^.loc in [LOC_REGISTER,LOC_FPUREGISTER,LOC_MMREGISTER]) then
|
||||
internalerror(2019011902);
|
||||
reducetosingleregparaloc(paraloc,hp.paraloc[side].def,paraloc^.register);
|
||||
end
|
||||
else if paraloc^.def=llvm_metadatatype then
|
||||
begin
|
||||
paraloc^.Loc:=LOC_REGISTER;
|
||||
// will be overwritten with a "register" whose superregister is an index in the LLVM metadata table
|
||||
paraloc^.register:=NR_INVALID;
|
||||
if assigned(paraloc^.next) and
|
||||
(hp.paraloc[side].def.typ in [orddef,enumdef,floatdef]) then
|
||||
begin
|
||||
if not(paraloc^.loc in [LOC_REGISTER,LOC_FPUREGISTER,LOC_MMREGISTER]) then
|
||||
internalerror(2019011902);
|
||||
reducetosingleregparaloc(paraloc,hp.paraloc[side].def,paraloc^.register);
|
||||
end
|
||||
else if paraloc^.def=llvm_metadatatype then
|
||||
begin
|
||||
paraloc^.Loc:=LOC_REGISTER;
|
||||
// will be overwritten with a "register" whose superregister is an index in the LLVM metadata table
|
||||
paraloc^.register:=NR_INVALID;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure tllvmparamanager.createtempparaloc(list: TAsmList; calloption: tproccalloption; parasym: tparavarsym; can_use_final_stack_loc: boolean; var cgpara: TCGPara);
|
||||
|
Loading…
Reference in New Issue
Block a user