* avoid internal error if an empty record is assigned to a function result, resolves #25895

git-svn-id: trunk@27223 -
This commit is contained in:
florian 2014-03-21 16:31:57 +00:00
parent 303e8c609d
commit 6f14dbdebe
3 changed files with 19 additions and 0 deletions

1
.gitattributes vendored
View File

@ -13847,6 +13847,7 @@ tests/webtbs/tw25814.pp svneol=native#text/plain
tests/webtbs/tw25869.pp svneol=native#text/plain
tests/webtbs/tw2588.pp svneol=native#text/plain
tests/webtbs/tw2589.pp svneol=native#text/plain
tests/webtbs/tw25895.pp svneol=native#text/pascal
tests/webtbs/tw2594.pp svneol=native#text/plain
tests/webtbs/tw2595.pp svneol=native#text/plain
tests/webtbs/tw2602.pp svneol=native#text/plain

View File

@ -1428,6 +1428,10 @@ implementation
var
tmploc: tlocation;
begin
{ skip e.g. empty records }
if (cgpara.location^.loc = LOC_VOID) then
exit;
{ Handle Floating point types differently
This doesn't depend on emulator settings, emulator settings should

14
tests/webtbs/tw25895.pp Normal file
View File

@ -0,0 +1,14 @@
{$MODE OBJFPC}
program test;
type
TDummy = record end;
function Foo(): TDummy;
begin
Result := Default(TDummy);
end; // Fatal: Internal error 2010053111
begin
Foo();
end.