mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 05:25:58 +02:00
* set the rangedef of open arrays to ptrsinttype (instead of s32inttype),
so that it's the same as the def returned by the low/high nodes (mantis #25703) git-svn-id: trunk@27970 -
This commit is contained in:
parent
5ad478b252
commit
24f4adf657
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -13940,6 +13940,7 @@ tests/webtbs/tw25605.pp svneol=native#text/pascal
|
|||||||
tests/webtbs/tw2561.pp svneol=native#text/plain
|
tests/webtbs/tw2561.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw25610.pp -text svneol=native#text/plain
|
tests/webtbs/tw25610.pp -text svneol=native#text/plain
|
||||||
tests/webtbs/tw25685.pp svneol=native#text/pascal
|
tests/webtbs/tw25685.pp svneol=native#text/pascal
|
||||||
|
tests/webtbs/tw25703.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw25781.pp svneol=native#text/plain
|
tests/webtbs/tw25781.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw25814.pp svneol=native#text/plain
|
tests/webtbs/tw25814.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw25869.pp svneol=native#text/plain
|
tests/webtbs/tw25869.pp svneol=native#text/plain
|
||||||
|
@ -685,10 +685,10 @@ implementation
|
|||||||
{ true, if p points to an open array def }
|
{ true, if p points to an open array def }
|
||||||
function is_open_array(p : tdef) : boolean;
|
function is_open_array(p : tdef) : boolean;
|
||||||
begin
|
begin
|
||||||
{ check for s32inttype is needed, because for u32bit the high
|
{ check for ptrsinttype is needed, because for unsigned the high
|
||||||
range is also -1 ! (PFV) }
|
range is also -1 ! (PFV) }
|
||||||
result:=(p.typ=arraydef) and
|
result:=(p.typ=arraydef) and
|
||||||
(tarraydef(p).rangedef=s32inttype) and
|
(tarraydef(p).rangedef=ptrsinttype) and
|
||||||
(tarraydef(p).lowrange=0) and
|
(tarraydef(p).lowrange=0) and
|
||||||
(tarraydef(p).highrange=-1) and
|
(tarraydef(p).highrange=-1) and
|
||||||
((tarraydef(p).arrayoptions * [ado_IsVariant,ado_IsArrayOfConst,ado_IsConstructor,ado_IsDynamicArray])=[]);
|
((tarraydef(p).arrayoptions * [ado_IsVariant,ado_IsArrayOfConst,ado_IsConstructor,ado_IsDynamicArray])=[]);
|
||||||
|
@ -399,7 +399,7 @@ implementation
|
|||||||
consume(_ARRAY);
|
consume(_ARRAY);
|
||||||
consume(_OF);
|
consume(_OF);
|
||||||
{ define range and type of range }
|
{ define range and type of range }
|
||||||
hdef:=carraydef.create(0,-1,s32inttype);
|
hdef:=carraydef.create(0,-1,ptrsinttype);
|
||||||
{ array of const ? }
|
{ array of const ? }
|
||||||
if (token=_CONST) and (m_objpas in current_settings.modeswitches) then
|
if (token=_CONST) and (m_objpas in current_settings.modeswitches) then
|
||||||
begin
|
begin
|
||||||
|
18
tests/webtbs/tw25703.pp
Normal file
18
tests/webtbs/tw25703.pp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ %norun }
|
||||||
|
{ %opt=-CO -Seh }
|
||||||
|
|
||||||
|
{$MODE OBJFPC}
|
||||||
|
type
|
||||||
|
TNode = class end;
|
||||||
|
|
||||||
|
procedure Test(const Arg: array of TNode);
|
||||||
|
var
|
||||||
|
Item: TNode;
|
||||||
|
begin
|
||||||
|
for Item in Arg do ; // Warning here
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
test([]);
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user