* fixed inlinetree parsing in det_resulttype

This commit is contained in:
peter 2002-11-27 02:31:17 +00:00
parent 2b6e06bd4a
commit 1ba12c259e

View File

@ -2756,15 +2756,64 @@ type
function tprocinlinenode.det_resulttype : tnode; function tprocinlinenode.det_resulttype : tnode;
var
storesymtablelevel : longint;
storeparasymtable,
storelocalsymtable : tsymtabletype;
oldprocdef : tprocdef;
oldprocinfo : tprocinfo;
oldinlining_procedure : boolean;
begin begin
result:=nil;
oldinlining_procedure:=inlining_procedure;
oldprocdef:=aktprocdef;
oldprocinfo:=procinfo;
{ we're inlining a procedure }
inlining_procedure:=true;
aktprocdef:=inlineprocdef;
{ clone procinfo, but not the asmlists }
procinfo:=tprocinfo(cprocinfo.newinstance);
move(pointer(oldprocinfo)^,pointer(procinfo)^,cprocinfo.InstanceSize);
procinfo.aktentrycode:=nil;
procinfo.aktexitcode:=nil;
procinfo.aktproccode:=nil;
procinfo.aktlocaldata:=nil;
{ set new procinfo }
procinfo.return_offset:=retoffset;
procinfo.para_offset:=para_offset;
procinfo.no_fast_exit:=false;
{ set it to the same lexical level }
storesymtablelevel:=aktprocdef.localst.symtablelevel;
storelocalsymtable:=aktprocdef.localst.symtabletype;
storeparasymtable:=aktprocdef.parast.symtabletype;
aktprocdef.localst.symtablelevel:=oldprocdef.localst.symtablelevel;
aktprocdef.localst.symtabletype:=inlinelocalsymtable;
aktprocdef.parast.symtabletype:=inlineparasymtable;
{ pass inlinetree }
resulttypepass(inlinetree);
resulttype:=inlineprocdef.rettype; resulttype:=inlineprocdef.rettype;
{ retrieve info from inlineprocdef } { retrieve info from inlineprocdef }
retoffset:=-POINTER_SIZE; { less dangerous as zero (PM) } retoffset:=-POINTER_SIZE; { less dangerous as zero (PM) }
para_offset:=0; para_offset:=0;
para_size:=inlineprocdef.para_size(target_info.alignment.paraalign); para_size:=inlineprocdef.para_size(target_info.alignment.paraalign);
if paramanager.ret_in_param(inlineprocdef.rettype.def,inlineprocdef.proccalloption) then if paramanager.ret_in_param(inlineprocdef.rettype.def,inlineprocdef.proccalloption) then
inc(para_size,POINTER_SIZE); inc(para_size,POINTER_SIZE);
result:=nil;
{ restore procinfo }
procinfo.free;
procinfo:=oldprocinfo;
{ restore symtable }
aktprocdef.localst.symtablelevel:=storesymtablelevel;
aktprocdef.localst.symtabletype:=storelocalsymtable;
aktprocdef.parast.symtabletype:=storeparasymtable;
{ restore }
aktprocdef:=oldprocdef;
inlining_procedure:=oldinlining_procedure;
end; end;
@ -2795,7 +2844,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.110 2002-11-25 18:43:32 carl Revision 1.111 2002-11-27 02:31:17 peter
* fixed inlinetree parsing in det_resulttype
Revision 1.110 2002/11/25 18:43:32 carl
- removed the invalid if <> checking (Delphi is strange on this) - removed the invalid if <> checking (Delphi is strange on this)
+ implemented abstract warning on instance creation of class with + implemented abstract warning on instance creation of class with
abstract methods. abstract methods.