mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 08:09:18 +02:00
* when calling an inline procedure inside a nested procedure, the
framepointer was being pushed on the stack, but this pushed framepointer was never used nor removed from the stack again after the inlining was done. It's now simply not pushed anymore, because the inlined procedure can get the previous framepointer from the procedure in which it is being inlined (merged)
This commit is contained in:
parent
bfa379a802
commit
100a911290
@ -837,6 +837,10 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ push base pointer ?}
|
{ push base pointer ?}
|
||||||
|
{ never when inlining, since if necessary, the base pointer }
|
||||||
|
{ can/will be gottten from the current procedure's symtable }
|
||||||
|
{ (JM) }
|
||||||
|
if not inlined then
|
||||||
if (lexlevel>=normal_function_level) and assigned(tprocdef(procdefinition).parast) and
|
if (lexlevel>=normal_function_level) and assigned(tprocdef(procdefinition).parast) and
|
||||||
((tprocdef(procdefinition).parast.symtablelevel)>normal_function_level) then
|
((tprocdef(procdefinition).parast.symtablelevel)>normal_function_level) then
|
||||||
begin
|
begin
|
||||||
@ -860,11 +864,11 @@ implementation
|
|||||||
end
|
end
|
||||||
{ this is only true if the difference is one !!
|
{ this is only true if the difference is one !!
|
||||||
but it cannot be more !! }
|
but it cannot be more !! }
|
||||||
else if (lexlevel=tprocdef(procdefinition).parast.symtablelevel-1) then
|
else if (lexlevel=(tprocdef(procdefinition).parast.symtablelevel)-1) then
|
||||||
begin
|
begin
|
||||||
emit_reg(A_PUSH,S_L,procinfo^.framepointer)
|
emit_reg(A_PUSH,S_L,procinfo^.framepointer)
|
||||||
end
|
end
|
||||||
else if (lexlevel>tprocdef(procdefinition).parast.symtablelevel) then
|
else if (lexlevel>(tprocdef(procdefinition).parast.symtablelevel)) then
|
||||||
begin
|
begin
|
||||||
hregister:=getregister32;
|
hregister:=getregister32;
|
||||||
new(r);
|
new(r);
|
||||||
@ -1584,7 +1588,15 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.32 2001-09-01 23:02:30 jonas
|
Revision 1.33 2001-09-09 08:50:15 jonas
|
||||||
|
* when calling an inline procedure inside a nested procedure, the
|
||||||
|
framepointer was being pushed on the stack, but this pushed framepointer
|
||||||
|
was never used nor removed from the stack again after the inlining was
|
||||||
|
done. It's now simply not pushed anymore, because the inlined procedure
|
||||||
|
can get the previous framepointer from the procedure in which it is being
|
||||||
|
inlined (merged)
|
||||||
|
|
||||||
|
Revision 1.32 2001/09/01 23:02:30 jonas
|
||||||
* i386*: call and jmp read their first operand
|
* i386*: call and jmp read their first operand
|
||||||
* cgcal: deallocate hlper register only after call statement (fixes bug
|
* cgcal: deallocate hlper register only after call statement (fixes bug
|
||||||
with "procedure of object" and optimizer reported to bugrep on
|
with "procedure of object" and optimizer reported to bugrep on
|
||||||
|
Loading…
Reference in New Issue
Block a user