* fixed crash with empty array constructor

This commit is contained in:
peter 1999-05-31 12:42:43 +00:00
parent c4334007df
commit e79d80a971

View File

@ -731,15 +731,18 @@ implementation
if not p^.cargs then
begin
reset_reference(p^.location.reference);
{ Allocate always a temp, also if no elements are required, to
ensure that location is valid (PFV) }
if parraydef(p^.resulttype)^.highrange=-1 then
begin
end
gettempofsizereference(8,p^.location.reference)
else
gettempofsizereference((parraydef(p^.resulttype)^.highrange+1)*8,p^.location.reference);
href:=p^.location.reference;
end;
hp:=p;
while assigned(hp) do
begin
if assigned(hp^.left) then
begin
secondpass(hp^.left);
if codegenerror then
@ -750,7 +753,8 @@ implementation
lt:=hp^.left^.resulttype;
case lt^.deftype of
enumdef,
orddef : begin
orddef :
begin
if (lt^.deftype=enumdef) or
is_integer(lt) then
vtype:=vtInteger
@ -761,22 +765,27 @@ implementation
if (lt^.deftype=orddef) and (porddef(lt)^.typ=uchar) then
vtype:=vtChar;
end;
floatdef : begin
floatdef :
begin
vtype:=vtExtended;
vaddr:=true;
end;
procvardef,
pointerdef : begin
pointerdef :
begin
if is_pchar(lt) then
vtype:=vtPChar
else
vtype:=vtPointer;
end;
classrefdef : vtype:=vtClass;
objectdef : begin
classrefdef :
vtype:=vtClass;
objectdef :
begin
vtype:=vtObject;
end;
stringdef : begin
stringdef :
begin
if is_shortstring(lt) then
begin
vtype:=vtString;
@ -816,6 +825,7 @@ implementation
emit_mov_loc_ref(hp^.left^.location,href);
inc(href.offset,4);
end;
end;
{ load next entry }
hp:=hp^.right;
end;
@ -825,7 +835,10 @@ implementation
end.
{
$Log$
Revision 1.59 1999-05-27 19:44:14 peter
Revision 1.60 1999-05-31 12:42:43 peter
* fixed crash with empty array constructor
Revision 1.59 1999/05/27 19:44:14 peter
* removed oldasm
* plabel -> pasmlabel
* -a switches to source writing automaticly