Is it already known that the XE7 Delphi compiler doesn't collapse duplicate string literals anymore? Delphi 2 - Delphi XE6 work as expected.

Is it already known that the XE7 Delphi compiler doesn't collapse duplicate string literals anymore? Delphi 2 - Delphi XE6 work as expected.

program DupStringCollapseBug;
{$APPTYPE CONSOLE}

function ToPtr(const S: string): Pointer;
begin
  Result := Pointer(S);
end;

begin
  if ToPtr('a1') <> ToPtr('a1') then
    WriteLn('Something is terribly wrong with the compiler');
end.

Comments

  1. +Leif It's interesting to me that the 32 bit compiler was bought rather than developed in-house. I hadn't realised that. I knew that was the case for TP, but I assumed that the 32 bit compiler was a development of the earlier TP compiler.

    ReplyDelete
  2. David, I could be getting this mixed up but I seem to remember someone (Allen? Danny? Chuck?) telling me it's based on a TP-compatible compiler for the Atari ST that Borland bought at one stage. The code lived on and ended up being the basis for dcc32.

    ReplyDelete
  3. I just ran a few tests and this appears to be fixed in XE8.

    (The Quality report was marked as resolved, too, but I just wanted to check. https://quality.embarcadero.com/browse/RSP-10015 )

    ReplyDelete

Post a Comment