[fpc-devel] Internal error in FPC 2.6.0rc1

Michael Müller mueller_michael at alice-dsl.net
Fri Nov 25 11:36:51 CET 2011


Hi,

I tested RC1 using one of my codes and ran into an internal error. I was able to reduce the code to the following.

Free Pascal Compiler version 2.6.0rc1 [2011/10/15] for i386
Copyright (c) 1993-2011 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling InternalError.dpr
InternalError.dpr(21,3) Fatal: Internal error 201103063
Fatal: Compilation aborted

--- Code, start ---

{$IFDEF FPC}
  {$MODE Delphi}
{$ENDIF}

program InternalError;

procedure SetArray({var}out SingleArray: array of Single; const Value: Single);
var
  I: Integer;
begin
  for I := Low(SingleArray) to High(SingleArray) do
    SingleArray[I] := Value;
end;

var
  ValuesBuffer: array of Single;

begin
  SetLength(ValuesBuffer, 5);
  SetArray(ValuesBuffer, 5.7);
end.

--- Code, end ---

The error is at the beginning of SetArray() call.

I see that the real error is in my code since the procedure parameter has to be 'var' and not 'out' otherwise the dimension which is set outside will not reach the procedure. But the compiler shouldn't stop with an internal error. If it is changed to 'var' it compiles.

FPC 2.4.4 just compiles it.

Regards

Michael


More information about the fpc-devel mailing list