View Issue Details

IDProjectCategoryView StatusLast Update
0031975FPCRTLpublic2017-07-19 01:25
ReporterM.AUDIOAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86-64OSWindowsOS Version7
Product Version3.1.1Product Buildr36176 
Target Version3.2.0Fixed in Version3.1.1 
Summary0031975: TStringHelper Function LastIndexOf Returns Exception
DescriptionTStringHelper Function LastIndexOf Returns SIGSEGV.
It is confirmed that it's not working at all when passed parameter is of type String.
Steps To ReproduceSample FPC project attached. run in debug mode.
Tagslastindexof, TStringHelper
Fixed in Revision36703
FPCOldBugId
FPCTarget
Attached Files

Activities

M.AUDIO

2017-06-07 20:06

reporter  

lasti.zip (1,081 bytes)

Bart Broersma

2017-06-07 21:27

reporter   ~0100939

Last edited: 2017-06-12 21:40

View 2 revisions

\rtl\objpas\sysutils\syshelp.inc
Line 640

function TStringHelper.LastIndexOf(const AValue: string; AStartIndex: Integer;
  ACount: Integer): Integer;
begin
  Result:=LastIndexOf(AValue,AStartIndex,AStartIndex+1);
end;

Basically calls itself infinitely...

jamie philbrook

2017-06-11 01:11

reporter   ~0101014

I could be wrong but, Could it be this?

 Result := LastIndexOf(AValue[AstartIndex],AStartIndex+1,ACount);

Thaddy de Koning

2017-06-12 09:52

reporter   ~0101047

Last edited: 2017-06-12 10:01

View 3 revisions

I don't think so. It can use rpos/rposex, but that would introduce a dependency on strutils.

Note IndexOf uses pos(), but pos() is a system function. rpos()/rposex() aren't.

Michael Van Canneyt

2017-07-09 10:43

administrator   ~0101627

Fixed, thanks for reporting.

Issue History

Date Modified Username Field Change
2017-06-07 20:06 M.AUDIO New Issue
2017-06-07 20:06 M.AUDIO File Added: lasti.zip
2017-06-07 20:07 M.AUDIO Tag Attached: TStringHelper
2017-06-07 20:07 M.AUDIO Tag Attached: lastindexof
2017-06-07 21:27 Bart Broersma Note Added: 0100939
2017-06-11 01:11 jamie philbrook Note Added: 0101014
2017-06-12 09:52 Thaddy de Koning Note Added: 0101047
2017-06-12 09:57 Thaddy de Koning Note Edited: 0101047 View Revisions
2017-06-12 10:01 Thaddy de Koning Note Edited: 0101047 View Revisions
2017-06-12 21:40 Bart Broersma Note Edited: 0100939 View Revisions
2017-07-09 10:43 Michael Van Canneyt Fixed in Revision => 36703
2017-07-09 10:43 Michael Van Canneyt Note Added: 0101627
2017-07-09 10:43 Michael Van Canneyt Status new => resolved
2017-07-09 10:43 Michael Van Canneyt Fixed in Version => 3.1.1
2017-07-09 10:43 Michael Van Canneyt Resolution open => fixed
2017-07-09 10:43 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-07-09 10:43 Michael Van Canneyt Target Version => 3.2.0