mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 07:39:25 +02:00
* 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:
parent
303e8c609d
commit
6f14dbdebe
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
14
tests/webtbs/tw25895.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user