* fixed value openarray

* ungettemp of arrayconstruct
This commit is contained in:
peter 1998-10-01 09:22:52 +00:00
parent 088781a22d
commit 2b44a66b5a
3 changed files with 63 additions and 24 deletions

View File

@ -613,6 +613,7 @@ implementation
i : longint; i : longint;
{ help reference pointer } { help reference pointer }
r : preference; r : preference;
hp,
pp,params : ptree; pp,params : ptree;
inlined : boolean; inlined : boolean;
inlinecode : ptree; inlinecode : ptree;
@ -1313,9 +1314,24 @@ implementation
while assigned(pp) do while assigned(pp) do
begin begin
if assigned(pp^.left) then if assigned(pp^.left) then
if (pp^.left^.location.loc=LOC_REFERENCE) or begin
(pp^.left^.location.loc=LOC_MEM) then if pp^.left^.location.loc in [LOC_REFERENCE,LOC_MEM] then
ungetiftemp(pp^.left^.location.reference); ungetiftemp(pp^.left^.location.reference);
{ process also all nodes of an array of const }
if pp^.left^.treetype=arrayconstructn then
begin
if assigned(pp^.left^.left) then
begin
hp:=pp^.left;
while assigned(hp) do
begin
if hp^.left^.location.loc in [LOC_REFERENCE,LOC_MEM] then
ungetiftemp(hp^.left^.location.reference);
hp:=hp^.right;
end;
end;
end;
end;
pp:=pp^.right; pp:=pp^.right;
end; end;
if inlined then if inlined then
@ -1437,7 +1453,11 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.31 1998-09-28 16:57:15 pierre Revision 1.32 1998-10-01 09:22:52 peter
* fixed value openarray
* ungettemp of arrayconstruct
Revision 1.31 1998/09/28 16:57:15 pierre
* changed all length(p^.value_str^) into str_length(p) * changed all length(p^.value_str^) into str_length(p)
to get it work with and without ansistrings to get it work with and without ansistrings
* changed sourcefiles field of tmodule to a pointer * changed sourcefiles field of tmodule to a pointer

View File

@ -608,23 +608,28 @@ implementation
end; end;
procedure emit_lea_tree_ref(const p:ptree;const ref:treference); procedure emit_to_reference(var p:ptree);
var
href : treference;
t : tlocation;
begin begin
t:=p^.location; case p^.location.loc of
case t.loc of
LOC_FPU : begin LOC_FPU : begin
reset_reference(href); reset_reference(p^.location.reference);
gettempofsizereference(10,href); gettempofsizereference(10,p^.location.reference);
floatstore(pfloatdef(p^.resulttype)^.typ,href); floatstore(pfloatdef(p^.resulttype)^.typ,p^.location.reference);
exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L, p^.location.loc:=LOC_REFERENCE;
newreference(href),R_EDI)));
exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV,S_L,
R_EDI,newreference(ref))));
end; end;
LOC_MEM, LOC_MEM,
LOC_REFERENCE : ;
else
internalerror(333);
end;
end;
procedure emit_lea_loc_ref(const t:tlocation;const ref:treference);
begin
case t.loc of
LOC_MEM,
LOC_REFERENCE : begin LOC_REFERENCE : begin
if t.reference.isintvalue then if t.reference.isintvalue then
internalerror(331) internalerror(331)
@ -710,7 +715,10 @@ implementation
inc(href.offset,4); inc(href.offset,4);
{ write changing field update href to the next element } { write changing field update href to the next element }
if vaddr then if vaddr then
emit_lea_tree_ref(hp^.left,href) begin
emit_to_reference(hp^.left);
emit_lea_loc_ref(hp^.left^.location,href)
end
else else
emit_mov_loc_ref(hp^.left^.location,href); emit_mov_loc_ref(hp^.left^.location,href);
inc(href.offset,4); inc(href.offset,4);
@ -723,7 +731,11 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.21 1998-09-28 11:07:39 peter Revision 1.22 1998-10-01 09:22:53 peter
* fixed value openarray
* ungettemp of arrayconstruct
Revision 1.21 1998/09/28 11:07:39 peter
+ floatdef support for array of const + floatdef support for array of const
Revision 1.20 1998/09/24 14:26:03 peter Revision 1.20 1998/09/24 14:26:03 peter

View File

@ -942,12 +942,15 @@
if assigned(definition) then if assigned(definition) then
begin begin
case varspez of case varspez of
vs_value : getsize:=definition^.size; vs_value : begin
if is_open_array(definition) then
getsize:=sizeof(pointer)+4
else
getsize:=definition^.size;
end;
vs_var : begin vs_var : begin
{ open arrays push also the high valye } { open arrays push also the high valye }
if (definition^.deftype=arraydef) and if is_open_array(definition) then
(parraydef(definition)^.lowrange=0) and
(parraydef(definition)^.highrange=-1) then
getsize:=sizeof(pointer)+4 getsize:=sizeof(pointer)+4
else else
getsize:=sizeof(pointer); getsize:=sizeof(pointer);
@ -1716,7 +1719,11 @@
{ {
$Log$ $Log$
Revision 1.48 1998-09-26 17:45:44 peter Revision 1.49 1998-10-01 09:22:55 peter
* fixed value openarray
* ungettemp of arrayconstruct
Revision 1.48 1998/09/26 17:45:44 peter
+ idtoken and only one token table + idtoken and only one token table
Revision 1.47 1998/09/24 15:11:17 peter Revision 1.47 1998/09/24 15:11:17 peter