anchor.diff:      opMATCH:begin
        if rfLONGEST in Instance.Flags then begin
         if not assigned(BestState) then begin
  -       BestState:=ParallelNFAStateAllocate(Instance.CountSubMatches,State^.BitState);
  -      end;
  -      if State^.BitState<>0 then begin
  +       BestState:=ParallelNFAStateAllocate(Instance.CountSubMatches,State^.SubMatchesBitMask);
  +      end;
  +      if State^.SubMatchesBitMask<>0 then begin
          if LastPosition<CurrentPosition then begin
           LastPosition:=CurrentPosition;
  -        BestState^.BitState:=State^.BitState;
  +        BestState^.SubMatchesBitMask:=State^.SubMatchesBitMask;
           Move(State^.SubMatches[0],BestState^.SubMatches[0],State^.Count*SizeOf(TFLREParallelNFAStateItem));
          end;
         end;
  
positive.code:  end;
   result^.ReferenceCounter:=1;
   result^.Count:=Count;
   result^.BitState:=BitState;
  end;
  
  function TFLREThreadLocalStorageInstance.ParallelNFAStateAcquire(const State:PFLREParallelNFAState):PFLREParallelNFAState; {$ifdef caninline}inline;{$endif}
  
negative.code: 
   if assigned(Matched) then begin
    SetLength(Captures,Instance.CountCaptures);
    SubMatchesBitMask:=Matched^.SubMatchesBitMask;
    for Counter:=0 to Instance.CountCaptures-1 do begin
     Capture:=@Captures[Counter];
     if (SubMatchesBitMask and longword($80000000))<>0 then begin
      CurrentPosition:=Matched^.SubMatches[Counter shl 1];
      CurrentLength:=Matched^.SubMatches[(Counter shl 1) or 1]-CurrentPosition;
     end else begin
      if (SubMatchesBitMask and (longword(1) shl (Counter shl 1)))<>0 then begin
       CurrentPosition:=Matched^.SubMatches[Counter shl 1];
      end else begin
       CurrentPosition:=0;
      end;
      if (SubMatchesBitMask and (longword(1) shl ((Counter shl 1) or 1)))<>0 then begin
       CurrentLength:=Matched^.SubMatches[(Counter shl 1) or 1]-CurrentPosition;
      end else begin
       CurrentLength:=0;
  