Access violation when replacing a pattern by an empty string #4

Closed
opened 2015-11-23 20:40:25 +00:00 by rchastain · 1 comment
rchastain commented 2015-11-23 20:40:25 +00:00 (Migrated from github.com)

Hello!

When I try to replace a pattern by an empty string, I get an access violation (FPC 2.6.4, Windows).

program testreplace;

uses
  Classes, SysUtils, FLRE, FLREUnicode;

begin
  with TFLRE.Create('\d', []) do
  begin
    MaximalDFAStates := 65536;
    WriteLn(Replace('a1b', '-'));
    WriteLn(Replace('a1b', '')); // Access violation
    Free;
  end;
end.

Best regards.

Roland

Hello! When I try to replace a pattern by an empty string, I get an access violation (FPC 2.6.4, Windows). ``` program testreplace; uses Classes, SysUtils, FLRE, FLREUnicode; begin with TFLRE.Create('\d', []) do begin MaximalDFAStates := 65536; WriteLn(Replace('a1b', '-')); WriteLn(Replace('a1b', '')); // Access violation Free; end; end. ``` Best regards. Roland
BeRo1985 commented 2015-11-23 22:24:31 +00:00 (Migrated from github.com)
Fixed at https://github.com/BeRo1985/flre/commit/8d3e8bdd8b73bcf7e3a6f1b32469c600a7b8bd86 :-)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BeRo1985/flre#4
No description provided.