Changeset 2012


Ignore:
Timestamp:
Oct 24, 2010, 1:52:48 PM (11 years ago)
Author:
Sven Rech
Message:

fixed empty regex bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/CostFunction/RegEx.cs

    r2008 r2012  
    5252            }
    5353
    54             //make epsilon transitions superfluous:
    55             nfa.RemoveEpsilonTransitions();
    56 
    57             //convert NFA to DFA:
    58             transitionMatrix = nfa.GetDFATransitionMatrix(out startIndex);
     54            if (nfa != null)
     55            {
     56                //make epsilon transitions superfluous:
     57                nfa.RemoveEpsilonTransitions();
     58
     59                //convert NFA to DFA:
     60                transitionMatrix = nfa.GetDFATransitionMatrix(out startIndex);
     61            }
    5962        }
    6063
     
    6568        /// <returns></returns>
    6669        public bool Matches(byte[] input)
    67         {           
     70        {
     71            if (transitionMatrix == null)
     72                return false;
     73
    6874            int state = startIndex;
    6975
Note: See TracChangeset for help on using the changeset viewer.