Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/RTL/Delphi/Format + Float    [ Add a report in this area ]  
Report #:  58688   Status: Closed
WideFormat with %p
Project:  Delphi Build #:  11.0.2804.9245
Version:    11.1 Submitted By:   Soeren Muehlbauer
Report Type:  Basic functionality failure Date Reported:  2/25/2008 7:22:20 AM
Severity:    Infrequently encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   257908
Resolution: Fixed (Resolution Comments) Resolved in Build: : 12.0.0.11596
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
i'm trying to use WideFormat with a pointer. My call to wideformat looks like this:

var
  P: Pointer;
  S: WideString;
begin
  P := Pointer($BADF00D);
  S := WideFormat('%p', [P]);
end;

The problem is that the result contains garbage. I have tracked it down to SysUtils.WideFormatBuf. There exists a label named @CvtPointer. I think the JMP to CvtInt is wrong. The jump should go to CvtIntW or CvtInteger.
Steps to Reproduce:
function TestIt: WideString;
var
  P: Pointer;
begin
  P := Pointer($BADF00D);
  Result := WideFormat('%p', [P]);
end;
Workarounds
Change the rtl. In SysUtils.WideFormatBuf at label @CvtPointer change the call to CvtInt to CvtIntW
Attachment
None
Comments

None

Server Response from: ETNACODE01