Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi    [ Add a report in this area ]  
Report #:  114578   Status: Closed
[ICE] Invoking an inline variadic method on a value returned from an inlined function
Project:  Delphi Build #:  18.0.4854.59655
Version:    18.0 Submitted By:   Blaise Thorn
Report Type:  Crash / Data loss / Total failure Date Reported:  4/3/2013 4:03:33 PM
Severity:    Infrequently encountered problem Last Updated: 4/15/2014 6:45:08 PM
Platform:    All platforms Internal Tracking #:   37994
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE6
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 35
Description
Prerequisites:
1. There is a call to an inline function that returns a value of a record type or an intrinsic type.
2. That call is chained with a call to a inline variadic method of that type.
3. Extra arguments are passed to the latter method.
Result: The compiler halts, reporting an internal error.

NB: Sadly, currently, the Delphi compiler does not seem to support inlining of variadic methods. However, it still should accept the INLINE directive on them (as it already does now), but, obviously, it should not crash regardless of whether the inlining is actually happening.

Tags: VarArgs F2084 ICE Ixxxx
Steps to Reproduce:
Compile both tests with DCC64.
Expected: success; Actual: internal error.
----------8<----------
{$Inline on}{CRUCIAL}

type R = record

A, B: Pointer;

procedure CrashDCC(const S: PWideChar)


cdecl varargs{CRUCIAL}; inline{CRUCIAL};
end;

procedure R.CrashDCC(const S: PWideChar);
begin
end;

function Go: R; inline{CRUCIAL};
begin
end;

procedure Test;
begin

Go.CrashDCC('hello', {CRUCIAL} 42)

// ^-- F2084 Internal Error: I13607
end;

begin

Test
end.
----------8<----------
{$Inline on}{CRUCIAL}

type Placeholder = PWideChar; // the same for others

type Helper = record helper for Placeholder

procedure CrashDCC(const S: PWideChar)


cdecl varargs{CRUCIAL}; inline{CRUCIAL};
end;

procedure Helper.CrashDCC(const S: PWideChar);
begin
end;

function Go: Placeholder; inline{CRUCIAL};
begin
end;

procedure Test;
begin

Go.CrashDCC('hello', 42)

// ^-- F2084 Internal Error: I13607
end;

begin

Test
end.
----------8<----------
Workarounds
None
Attachment
None
Comments

None

Server Response from: ETNACODE01