* factor() might return a typenode with a errordef, so check for that and don't add the typesymbol to the parameter list in that case; fixes the access violation of tw17181.pp

git-svn-id: trunk@34472 -
This commit is contained in:
svenbarth 2016-09-09 13:04:41 +00:00
parent 9e6077bee2
commit 627e30f47f

View File

@ -345,11 +345,13 @@ uses
parampos^:=tmpparampos; parampos^:=tmpparampos;
poslist.add(parampos); poslist.add(parampos);
end; end;
genericdeflist.Add(typeparam.resultdef); if typeparam.resultdef.typ<>errordef then
begin
if not assigned(typeparam.resultdef.typesym) then if not assigned(typeparam.resultdef.typesym) then
message(type_e_generics_cannot_reference_itself) message(type_e_generics_cannot_reference_itself)
else else if (typeparam.resultdef.typ<>errordef) then
begin begin
genericdeflist.Add(typeparam.resultdef);
{ we use the full name of the type to uniquely identify it } { we use the full name of the type to uniquely identify it }
if (symtablestack.top.symtabletype=parasymtable) and if (symtablestack.top.symtabletype=parasymtable) and
(symtablestack.top.defowner.typ=procdef) and (symtablestack.top.defowner.typ=procdef) and
@ -371,6 +373,11 @@ uses
prettyname:=prettyname+prettynamepart+typeparam.resultdef.typesym.prettyname; prettyname:=prettyname+prettynamepart+typeparam.resultdef.typesym.prettyname;
end; end;
end end
else
begin
result:=false;
end;
end
else else
begin begin
Message(type_e_type_id_expected); Message(type_e_type_id_expected);