* allow absolutes on open arrays (use of this is doubtful though), resolves #41147

This commit is contained in:
florian 2025-02-11 22:45:19 +01:00
parent 637fa74c5c
commit 29b3b09251
3 changed files with 17 additions and 1 deletions

View File

@ -4667,6 +4667,7 @@ implementation
if result and
{ don't try to check the size of an open array }
(is_open_array(resultdef) or
is_open_array(left.resultdef) or
(resultdef.size<left.resultdef.size) or
((resultdef.size=left.resultdef.size) and
(left.resultdef.size<sizeof(aint)) and

View File

@ -23,7 +23,7 @@ unit aoptx86;
{$i fpcdefs.inc}
{$define DEBUG_AOPTCPU}
{ $define DEBUG_AOPTCPU}
{$ifdef EXTDEBUG}
{$define DEBUG_AOPTCPU}

15
tests/webtbs/tw41147.pp Normal file
View File

@ -0,0 +1,15 @@
{ %norun }
{ the code makes no sense, but it should compile }
{$MODE OBJFPC}
{$MODESWITCH ADVANCEDRECORDS+}
program test;
procedure Resolve(out Unsigned: array of QWord);
var
Signed: array of Int64 absolute Unsigned;
begin
SetLength(Signed, 0);
end;
begin
end.