anchor.diff:   Instance:=ThreadLocalStorageInstance.Instance;
   
    if AReversed then begin
  +
  +  CountInstructions:=Instance.CountBackwardInstructions;
  +
     MatchMode:=mmLongestMatch;
  +
    end else begin
  +
  +  CountInstructions:=Instance.CountForwardInstructions;
  +
     MatchMode:=ThreadLocalStorageInstance.MatchMode;
  - end;
  +
  + end;
  +
  + NeedMark:=MatchMode=mmLongestMatch;
   
    Reversed:=AReversed;
   
  
positive.code:   WorkQueues[0]:=nil;
    WorkQueues[1]:=nil;
   end else begin
    WorkQueues[0]:=TFLREDFAWorkQueue.Create(Max(Instance.CountForwardInstructions,Instance.CountBackwardInstructions)*3);
    WorkQueues[1]:=TFLREDFAWorkQueue.Create(Max(Instance.CountForwardInstructions,Instance.CountBackwardInstructions)*3);
    SetLength(QueueInstructionArray,Max(Instance.CountForwardInstructions,Instance.CountBackwardInstructions)*3);
    SetLength(QueueStack,Max(Instance.CountForwardInstructions,Instance.CountBackwardInstructions)*3);
   end;
  
  end;
  
negative.code:     end;
      opJMP,opSAVE,opMULTIMATCH,opLOOKBEHINDNEGATIVE,opLOOKBEHINDPOSITIVE,opLOOKAHEADNEGATIVE,opLOOKAHEADPOSITIVE,opBACKREFERENCE,opBACKREFERENCEIGNORECASE:begin
       // No-ops at DFA
       if (StackPointer+1)>length(QueueStack) then begin
        SetLength(QueueStack,(StackPointer+1)*2);
       end;
       QueueStack[StackPointer]:=Instruction^.Next;
       inc(StackPointer);
      end;
      opSPLIT,opSPLITMATCH:begin
       if (StackPointer+3)>length(QueueStack) then begin
        SetLength(QueueStack,(StackPointer+3)*2);
       end;
       QueueStack[StackPointer]:=Instruction^.OtherNext;
       inc(StackPointer);
       if NeedMark and IsUnanchored and assigned(Instruction) then begin
        QueueStack[StackPointer]:=Mark;
        inc(StackPointer);
       end;
  