[fpc-devel]Bugs in setlength for multidimensional dynamic arrays: first partial fix

Jonas Maebe jonas at zeus.rug.ac.be
Mon Sep 24 13:45:24 CEST 2001


On woensdag, september 12, 2001, at 10:00 , Pavel V. Ozerski wrote:

> I tried to find causes of buggy behavior of the last 1.1 compiler if it 
> tries to compile source with
> multidimensional dynamic arrays. The problem is not fully fixed but at 
> least after my fix compiler does not
> reject SetLength with more than two parameters (but it works 
> incorrectly then). My solution seems to be not a hack
> but a typical bugfix.

You're correct, I've applied your fix. It seems however that before 
multiple dimensions are supported properly for dynamical arrays, a lot 
of things stil have to be changed in the compiler :( Currently, if you 
declare

var
   a: array of longint;


then a[<some index>] has always longint as return type. This means that 
a[1,1] won't be accepted, and high(a[1]) returns maxlongint. I don't 
really know how to fix this cleanly in the compiler, since in some cases 
you need "array of longint" as result type when using a[0], and in other 
cases you need "longint".


Jonas




More information about the fpc-devel mailing list