Skip to content

Commit 0f52877

Browse files
committed
EKCAK: fixed the refactoring of FirstUnitNameChar in AppendClassNameToBuffer; was AnsiChar, which got the wrong output, is now PAnsiChar as it should have been.
1 parent c1f3247 commit 0f52877

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

FastMM4.pas

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3601,7 +3601,7 @@ TClassData = record
36013601
function AppendClassNameToBuffer(AClass: TClass; ADestination: PAnsiChar): PAnsiChar;
36023602
var
36033603
{$ifdef EnableMemoryLeakReportingUsesQualifiedClassName}
3604-
FirstUnitNameChar: AnsiChar;
3604+
FirstUnitNameChar: PAnsiChar;
36053605
LClassInfo: Pointer;
36063606
UnitName: PShortString;
36073607
{$endif EnableMemoryLeakReportingUsesQualifiedClassName}
@@ -3617,9 +3617,9 @@ function AppendClassNameToBuffer(AClass: TClass; ADestination: PAnsiChar): PAnsi
36173617
if LClassInfo <> nil then // prepend the UnitName
36183618
begin
36193619
UnitName := @PClassData(PByte(LClassInfo) + 2 + PByte(PByte(LClassInfo) + 1)^).UnitName;
3620-
FirstUnitNameChar := UnitName^[1];
3621-
if FirstUnitNameChar <> '@' then
3622-
Result := AppendStringToBuffer(@FirstUnitNameChar, Result, Length(UnitName^))
3620+
FirstUnitNameChar := @UnitName^[1];
3621+
if FirstUnitNameChar^ <> '@' then
3622+
Result := AppendStringToBuffer(FirstUnitNameChar, Result, Length(UnitName^))
36233623
else // Pos does no memory allocations, so it is safe to use
36243624
begin // Skip the '@', then copy until the ':' - never seen this happen in Delphi, but might be a C++ thing
36253625
Result := AppendStringToBuffer(@UnitName^[2], Result, Pos(ShortString(':'), UnitName^) - 2)

0 commit comments

Comments
 (0)