mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 03:46:10 +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/tw25869.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2588.pp svneol=native#text/plain
|
tests/webtbs/tw2588.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2589.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/tw2594.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2595.pp svneol=native#text/plain
|
tests/webtbs/tw2595.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2602.pp svneol=native#text/plain
|
tests/webtbs/tw2602.pp svneol=native#text/plain
|
||||||
|
@ -1428,6 +1428,10 @@ implementation
|
|||||||
var
|
var
|
||||||
tmploc: tlocation;
|
tmploc: tlocation;
|
||||||
begin
|
begin
|
||||||
|
{ skip e.g. empty records }
|
||||||
|
if (cgpara.location^.loc = LOC_VOID) then
|
||||||
|
exit;
|
||||||
|
|
||||||
{ Handle Floating point types differently
|
{ Handle Floating point types differently
|
||||||
|
|
||||||
This doesn't depend on emulator settings, emulator settings should
|
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