* fixed crash with inherited with varsym/propsym

This commit is contained in:
peter 2000-03-23 15:56:59 +00:00
parent 273373602f
commit d75bbf8b73

View File

@ -867,7 +867,7 @@ unit pexpr;
possible_error, possible_error,
unit_specific, unit_specific,
again : boolean; again : boolean;
sym : pvarsym; sym : psym;
classh : pobjectdef; classh : pobjectdef;
d : bestreal; d : bestreal;
static_name : string; static_name : string;
@ -1446,17 +1446,18 @@ unit pexpr;
case pd^.deftype of case pd^.deftype of
recorddef: recorddef:
begin begin
sym:=pvarsym(precorddef(pd)^.symtable^.search(pattern)); sym:=precorddef(pd)^.symtable^.search(pattern);
if sym=nil then if assigned(sym) and
(sym^.typ=varsym) then
begin
p1:=gensubscriptnode(pvarsym(sym),p1);
pd:=pvarsym(sym)^.vartype.def;
end
else
begin begin
Message1(sym_e_illegal_field,pattern); Message1(sym_e_illegal_field,pattern);
disposetree(p1); disposetree(p1);
p1:=genzeronode(errorn); p1:=genzeronode(errorn);
end
else
begin
p1:=gensubscriptnode(sym,p1);
pd:=sym^.vartype.def;
end; end;
consume(_ID); consume(_ID);
end; end;
@ -1467,7 +1468,7 @@ unit pexpr;
sym:=nil; sym:=nil;
while assigned(classh) do while assigned(classh) do
begin begin
sym:=pvarsym(classh^.symtable^.search(pattern)); sym:=classh^.symtable^.search(pattern);
srsymtable:=classh^.symtable; srsymtable:=classh^.symtable;
if assigned(sym) then if assigned(sym) then
break; break;
@ -1497,7 +1498,7 @@ unit pexpr;
allow_only_static:=false; allow_only_static:=false;
while assigned(classh) do while assigned(classh) do
begin begin
sym:=pvarsym(classh^.symtable^.search(pattern)); sym:=classh^.symtable^.search(pattern);
srsymtable:=classh^.symtable; srsymtable:=classh^.symtable;
if assigned(sym) then if assigned(sym) then
break; break;
@ -1654,7 +1655,7 @@ unit pexpr;
sym:=nil; sym:=nil;
while assigned(classh) do while assigned(classh) do
begin begin
sym:=pvarsym(classh^.symtable^.search(pattern)); sym:=classh^.symtable^.search(pattern);
srsymtable:=classh^.symtable; srsymtable:=classh^.symtable;
if assigned(sym) then if assigned(sym) then
break; break;
@ -1711,18 +1712,30 @@ unit pexpr;
while assigned(classh) do while assigned(classh) do
begin begin
srsymtable:=pobjectdef(classh)^.symtable; srsymtable:=pobjectdef(classh)^.symtable;
sym:=pvarsym(srsymtable^.search(pattern)); sym:=srsymtable^.search(pattern);
if assigned(sym) then if assigned(sym) then
begin begin
{ only for procsyms we need to set the type (PFV) } { only for procsyms we need to set the type (PFV) }
if sym^.typ=procsym then case sym^.typ of
begin procsym :
p1:=genzeronode(typen); begin
p1^.resulttype:=classh; p1:=genzeronode(typen);
pd:=p1^.resulttype; p1^.resulttype:=classh;
end pd:=p1^.resulttype;
else end;
p1:=nil; varsym :
begin
p1:=nil;
pd:=pvarsym(sym)^.vartype.def;
end;
propertysym :
begin
p1:=nil;
pd:=ppropertysym(sym)^.proptype.def;
end;
else
internalerror(83251763);
end;
consume(_ID); consume(_ID);
do_member_read(false,sym,p1,pd,again); do_member_read(false,sym,p1,pd,again);
break; break;
@ -2141,7 +2154,10 @@ _LECKKLAMMER : begin
end. end.
{ {
$Log$ $Log$
Revision 1.172 2000-03-19 11:22:21 peter Revision 1.173 2000-03-23 15:56:59 peter
* fixed crash with inherited with varsym/propsym
Revision 1.172 2000/03/19 11:22:21 peter
* protected member check for classes works * protected member check for classes works
Revision 1.171 2000/03/16 15:13:03 pierre Revision 1.171 2000/03/16 15:13:03 pierre