Skip to content

Dimension error in function DynArrayBounds

In FPC 3.2.2.there is a bug in dynarr.inc:

If I execute this code:

var
 anArray : array of array or array of Double;
 Dimensions : TBoundArray;
begin
  SetLength(anArray, 4, 3, 3);
  aPointer := TypeInfo(anArray);
  Dimensions := DynArrayBounds(@anArray, aPointer);
end.  

The debugger tells me that in Dimensions I have Dimensions = Len=3: (0, 3, 2)

but it should tell me Dimensions = Len=3: (3, 2, 2)


The fix is simple: in dynarr.inc the function "DynArrayBounds" has to be changed that 2 lines are exchanged. See the PR I will put for this issue.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information