* allow absolute on array of const parameters, resolves #41292

This commit is contained in:
florian 2025-06-23 22:21:16 +02:00
parent 198106e43e
commit b6a686930a
2 changed files with 15 additions and 1 deletions

View File

@ -1329,8 +1329,9 @@ implementation
{ the same size since it refers to the field and not to }
{ the whole record -- which is why we use pt and not hp) }
{ we can't take the size of an open array }
{ we can't take the size of an open array or an array of const }
if is_open_array(pt.resultdef) or
is_array_of_const(pt.resultdef) or
(vs.vardef.size <> pt.resultdef.size) then
make_not_regable(pt,[ra_addr_regable]);
end

13
tests/webtbs/tw41292.pp Normal file
View File

@ -0,0 +1,13 @@
{$mode delphi}
procedure proc(arg: array of const);
var
p: array[0..999] of TVarRec absolute arg;
begin
writeln(p[0].VInteger);
writeln(String(p[1].VPointer));
writeln(String(p[2].VPointer));
end;
begin
proc([100, 'foo', 'bar']);
end.