Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Generics    [ Add a report in this area ]  
Report #:  108942   Status: Closed
REGRESSION: Internal error G9413
Project:  Delphi Build #:  17.0.4625.53395
Version:    17.0 Submitted By:   Primoz Gabrijelcic
Report Type:  Crash / Data loss / Total failure Date Reported:  9/23/2012 5:11:06 AM
Severity:    Commonly encountered problem Last Updated: 4/23/2013 8:08:29 AM
Platform:    All platforms Internal Tracking #:   32186
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE4
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 21
Description
Compiler stops with [dcc32 Fatal Error] Unit136.pas(28): F2084 Internal Error: G9413

Fails only with 32-bit compiler, 64-bit compiler works fine.

//USc: This is regression from XE2.
Steps to Reproduce:
By USc:
- save program and unit below
- dcc32/dccosx QC108942.dpr

expected: it compiles
actual: QC108942.dpr(22) Fatal: F2084 Internal Error: G9413

//--- QC108942.dpr --
program QC108942;

{$APPTYPE CONSOLE}

uses
  RttiSimplified;

type
  TTest<T> = class
    procedure Test;
  end;

procedure TTest<T>.Test;
var
  RttiMethod: TRttiMethod;
begin
  if Length(RttiMethod.GetParameters) = 0 then;
end;

begin
  WriteLn('PASS'); // on compile
end.
//--- RttiSimplified.pas ---
unit RttiSimplified;

interface

type
  TRttiMethod = class(TObject)
    function GetParameters: TArray<TObject>; virtual; abstract;
  end;

implementation

end.



Original steps:
Compile this unit with 32-bit Windows compiler:

unit Unit136;

interface

implementation

uses
  RTTI;

type
  TTest<T> = class
    procedure Test;
  end;

var
  a: IInterface;

procedure TTest<T>.Test;
var
  aMethCreate : TRttiMethod;
begin
  if Length(aMethCreate.GetParameters) = 0 then
end;

initialization
  a := nil;
end.
Workarounds
Introducing temporary variable solves the problem:

unit Unit136;

interface

implementation

uses
  RTTI;

type
  TTest<T> = class
    procedure Test;
  end;

var
  a: IInterface;

procedure TTest<T>.Test;
var
  aMethCreate : TRttiMethod;
  param: TArray<TRttiParameter>;
begin
  param := aMethCreate.GetParameters;
  if Length(param) = 0 then
end;

initialization
  a := nil;
end.
Attachment
None
Comments

None

Server Response from: ETNACODE01