* support typecasts for passing @var to formal const

This commit is contained in:
peter 2004-02-26 16:12:04 +00:00
parent c9ae483263
commit a6f79c3c7f

View File

@ -332,6 +332,7 @@ implementation
var var
otlabel, otlabel,
oflabel : tasmlabel; oflabel : tasmlabel;
hp : tnode;
begin begin
if not(assigned(paraitem)) or if not(assigned(paraitem)) or
not(assigned(paraitem.paratype.def)) or not(assigned(paraitem.paratype.def)) or
@ -381,9 +382,12 @@ implementation
(left.location.loc=LOC_CONSTANT) then (left.location.loc=LOC_CONSTANT) then
location_force_mem(exprasmlist,left.location); location_force_mem(exprasmlist,left.location);
{ allow @var } { allow (typecasted) @var }
if (left.nodetype=addrn) and hp:=left;
(not(nf_procvarload in left.flags)) then while (hp.nodetype=typeconvn) do
hp:=ttypeconvnode(hp).left;
if (hp.nodetype=addrn) and
(not(nf_procvarload in hp.flags)) then
begin begin
inc(tcgcallnode(aktcallnode).pushedparasize,POINTER_SIZE); inc(tcgcallnode(aktcallnode).pushedparasize,POINTER_SIZE);
location_release(exprasmlist,left.location); location_release(exprasmlist,left.location);
@ -639,9 +643,10 @@ implementation
regs_to_alloc, regs_to_alloc,
regs_to_free : Tcpuregisterset; regs_to_free : Tcpuregisterset;
oldpushedparasize : longint; oldpushedparasize : longint;
{ adress returned from an I/O-error } {$ifdef cputargethasfixedstack}
{ help reference pointer } href2,
href,href2 : treference; {$endif cputargethasfixedstack}
href : treference;
pop_size : longint; pop_size : longint;
pvreg, pvreg,
vmtreg : tregister; vmtreg : tregister;
@ -1236,7 +1241,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.158 2004-02-22 13:01:15 daniel Revision 1.159 2004-02-26 16:12:04 peter
* support typecasts for passing @var to formal const
Revision 1.158 2004/02/22 13:01:15 daniel
* Fixed memory leak * Fixed memory leak
Revision 1.157 2004/02/22 12:04:04 florian Revision 1.157 2004/02/22 12:04:04 florian