View Issue Details

IDProjectCategoryView StatusLast Update
0038063FPCRTLpublic2020-11-12 10:27
ReporterWallaby Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0038063: TStringBuilder.Remove bug when deleting everything
DescriptionUsing the trunk. There is a bug in the TStringBuilder class in its Remove() method.

The following code throws a range error. The same code works in Delphi correctly.

var
  SB: TStringBuilder;
begin
  SB := TStringBuilder.Create;
  try
    SB.Append('ABC');
    ShowMessage(SB.ToString);

    SB.Remove(0, 3);//fails range check
    //SB.Remove(0, 2);//removes AB

    ShowMessage(SB.ToString);
  finally
    SB.Free;
  end;
Steps To ReproduceRun the above code. Note when deleting the first two letters (0, 2) it works as it should and removes AB.

Deleting all three letters throws a range check error, while it should just delete ABC and leave the string builder empty.
TagsNo tags attached.
Fixed in Revision47392
FPCOldBugId
FPCTarget3.2.2
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-11-11 06:02 Wallaby New Issue
2020-11-11 09:17 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-11-11 09:17 Michael Van Canneyt Status new => assigned
2020-11-12 10:27 Michael Van Canneyt Status assigned => resolved
2020-11-12 10:27 Michael Van Canneyt Resolution open => fixed
2020-11-12 10:27 Michael Van Canneyt Fixed in Version => 3.3.1
2020-11-12 10:27 Michael Van Canneyt Fixed in Revision => 47392
2020-11-12 10:27 Michael Van Canneyt FPCTarget => 3.2.2