Here is a very short program which now fails with a value out of range error:
PROGRAM dyn_arr_test(input,output);
TYPE
Dyn_arr2( Max_index1, Max_index2 : INTEGER ) = ARRAY [1..Max_index1, 1..Max_index2] OF single;
Ptr_to_dyn_arr2 = ^Dyn_arr2;
VAR
test2 : Ptr_to_dyn_arr2;
BEGIN
new(test2, 181, 181);
writeln('This works');
new(test2, 182, 182);
writeln('This works');
new(test2, 183, 183);
writeln('This fails');
dispose(test2);
END.
Turning off range-checking doesn't seem to work!
$ gpc --no-range-checking -o dyn_arr_test dyn_arr_test.pas
I'm aware there are problems in this area. I hope this helps.
I'm using gpc-20050217 with gcc-3.4.2 under Fedora Core 3.
Regards
David Wood
The Information contained in this E-Mail and any subsequent correspondence is private and is intended solely for the intended recipient(s). For those other than the recipient any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on such information is prohibited and may be unlawful.
Emails and other electronic communication with QinetiQ may be monitored. Calls to QinetiQ may be recorded for quality control, regulatory and monitoring purposes.
On Tue, Feb 22, 2005 at 10:44:11AM -0000, Wood David wrote:
Here is a very short program which now fails with a value out of range error:
PROGRAM dyn_arr_test(input,output);
TYPE
Dyn_arr2( Max_index1, Max_index2 : INTEGER ) = ARRAY [1..Max_index1, 1..Max_index2] OF single;
Ptr_to_dyn_arr2 = ^Dyn_arr2;
VAR
test2 : Ptr_to_dyn_arr2;
BEGIN
new(test2, 181, 181);
writeln('This works');
new(test2, 182, 182);
writeln('This works');
new(test2, 183, 183);
writeln('This fails');
dispose(test2);
END.
It seems to be an incarnation of the AddHeapRange problem discussed in another thread. Try the patch gpc.diff-uc which Frank posted yesterday.
Turning off range-checking doesn't seem to work!
$ gpc --no-range-checking -o dyn_arr_test dyn_arr_test.pas
This turns off range checking in your own code, not in the Run Time System.
Emil Jerabek
Wood David wrote:
Here is a very short program which now fails with a value out of range error:
I don't get a failure, but since the type size is near 128 KB, this looks like the bug found by Emil Jerabek. You might want to try my patch (gpc.diff-uc). You'll need to rebuild the RTS after applying it.
Frank