mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-10 22:29:23 +02:00
* allow absolute on array of const parameters, resolves #41292
This commit is contained in:
parent
198106e43e
commit
b6a686930a
@ -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
13
tests/webtbs/tw41292.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user