mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 04:59:25 +02:00
* load a dummy value on the fpu stack in the epilog of functions
which return a real but which never assigned anything to the function result (since the caller will pop it off again) (x86-only, bug #4902) git-svn-id: trunk@3016 -
This commit is contained in:
parent
a446c578ef
commit
1e3137c315
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6760,6 +6760,7 @@ tests/webtbs/tw4893a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4893b.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4893c.pp svneol=native#text/plain
|
||||
tests/webtbs/tw4898.pp -text
|
||||
tests/webtbs/tw4902.pp -text
|
||||
tests/webtbs/tw4922.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1873.pp svneol=native#text/plain
|
||||
tests/webtbs/ub1883.pp svneol=native#text/plain
|
||||
|
@ -1258,7 +1258,15 @@ implementation
|
||||
else
|
||||
internalerror(200405025);
|
||||
end;
|
||||
end;
|
||||
end
|
||||
{$ifdef x86}
|
||||
else
|
||||
begin
|
||||
{ the caller will pop a value off the cpu stack }
|
||||
if (funcretloc.loc = LOC_FPUREGISTER) then
|
||||
list.concat(taicpu.op_none(A_FLDZ));
|
||||
end;
|
||||
{$endif x86}
|
||||
end;
|
||||
|
||||
|
||||
|
16
tests/webtbs/tw4902.pp
Normal file
16
tests/webtbs/tw4902.pp
Normal file
@ -0,0 +1,16 @@
|
||||
{ Source provided for Free Pascal Bug Report 4902 }
|
||||
{ Submitted by "Yu Hang" on 2006-03-14 }
|
||||
{ e-mail: cosechy@gmail.com }
|
||||
function x:real;
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
x;
|
||||
{anything here}
|
||||
writeln(1);
|
||||
writeln(2);
|
||||
writeln(3);
|
||||
{crash here}
|
||||
writeln(1.0)
|
||||
end.
|
Loading…
Reference in New Issue
Block a user