I wrote the following code:
PROCEDURE play( map : map_type ); VAR
player1 : player_type( 'O', 'a', 'd', 'w', 's', red, right, 10, 10, 3 ); player2 : player_type( 'O', Crt.ksLeft, Crt.ksRight, Crt.ksUp, Crt.ksDown, green, left, 15, 15, 3 ); table : table_type_ptr;
BEGIN
new( table, map.width, map.height );
...
END;
END;
And here are the important types:
x_coordinate_type = 1..table_width; x_dimension_type = 1..table_width;
map_type( w, h, p1x, p1y, p2x, p2y : INTEGER ) = RECORD
width : x_dimension_type VALUE w; height : y_dimension_type VALUE h; player1_pos : player_pos_type VALUE [ p1x; p1y ]; player2_pos : player_pos_type VALUE [ p2x; p2y ]; collision : BOOLEAN VALUE FALSE; data : ARRAY[ 1..h, 1..w ] OF CHAR;
END;
table_type( w, h : INTEGER ) = ARRAY[ 1..h, 1..w ] OF field_type; table_type_ptr = ^table_type;
When I want to compile the code I get the following error:
snake.pas: In procedure `play': snake.pas:203: internal compiler error: in process_otherwise, at p/typecheck.c:4407 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://www.gnu-pascal.de/todo.html for instructions. For Debian GNU/Linux specific bug reporting instructions, see URL:file:///usr/share/doc/gcc-4.1/README.Bugs.
The problem is the call to new. Is this my fault?