mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-15 10:51:08 +02:00
* fixed crash when childof was nil
This commit is contained in:
parent
cbd7de9e6f
commit
2f95239feb
@ -1370,15 +1370,12 @@ unit pdecl;
|
|||||||
if token=_LKLAMMER then
|
if token=_LKLAMMER then
|
||||||
begin
|
begin
|
||||||
consume(_LKLAMMER);
|
consume(_LKLAMMER);
|
||||||
{ does not allow objects.tobject !! }
|
|
||||||
{if token<>ID then
|
|
||||||
consume(_ID);
|
|
||||||
getsym(pattern,true);}
|
|
||||||
childof:=pobjectdef(id_type(pattern));
|
childof:=pobjectdef(id_type(pattern));
|
||||||
if (childof^.deftype<>objectdef) then
|
if (childof^.deftype<>objectdef) then
|
||||||
begin
|
begin
|
||||||
Message1(type_e_class_type_expected,childof^.typename);
|
Message1(type_e_class_type_expected,childof^.typename);
|
||||||
childof:=nil;
|
childof:=nil;
|
||||||
|
aktclass:=new(pobjectdef,init(n,nil));
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -1386,12 +1383,10 @@ unit pdecl;
|
|||||||
if (childof^.is_class and not is_a_class) or
|
if (childof^.is_class and not is_a_class) or
|
||||||
(not childof^.is_class and is_a_class) then
|
(not childof^.is_class and is_a_class) then
|
||||||
Message(parser_e_mix_of_classes_and_objects);
|
Message(parser_e_mix_of_classes_and_objects);
|
||||||
end;
|
{ the forward of the child must be resolved to get
|
||||||
|
correct field addresses }
|
||||||
if assigned(fd) then
|
if assigned(fd) then
|
||||||
begin
|
begin
|
||||||
{ the forward of the child must be resolved to get
|
|
||||||
correct field addresses
|
|
||||||
}
|
|
||||||
if (oo_is_forward in childof^.objectoptions) then
|
if (oo_is_forward in childof^.objectoptions) then
|
||||||
Message1(parser_e_forward_declaration_must_be_resolved,childof^.objname^);
|
Message1(parser_e_forward_declaration_must_be_resolved,childof^.objname^);
|
||||||
aktclass:=fd;
|
aktclass:=fd;
|
||||||
@ -1403,6 +1398,7 @@ unit pdecl;
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
aktclass:=new(pobjectdef,init(n,childof));
|
aktclass:=new(pobjectdef,init(n,childof));
|
||||||
|
end;
|
||||||
consume(_RKLAMMER);
|
consume(_RKLAMMER);
|
||||||
end
|
end
|
||||||
{ if no parent class, then a class get tobject as parent }
|
{ if no parent class, then a class get tobject as parent }
|
||||||
@ -2408,7 +2404,10 @@ unit pdecl;
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.144 1999-08-14 00:38:53 peter
|
Revision 1.145 1999-08-26 21:17:39 peter
|
||||||
|
* fixed crash when childof was nil
|
||||||
|
|
||||||
|
Revision 1.144 1999/08/14 00:38:53 peter
|
||||||
* hack to support property with record fields
|
* hack to support property with record fields
|
||||||
|
|
||||||
Revision 1.143 1999/08/09 22:19:53 peter
|
Revision 1.143 1999/08/09 22:19:53 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user