core/sm_trie.cpp
changeset 195 625a44869e15
parent 194 762462458f3c
child 211 4c77142eaf36
     1.1 --- a/core/sm_trie.cpp	Thu Dec 07 08:17:19 2006 +0000
     1.2 +++ b/core/sm_trie.cpp	Thu Dec 07 19:10:26 2006 +0000
     1.3 @@ -263,7 +263,7 @@
     1.4  {
     1.5  	free(trie->base);
     1.6  	free(trie->stringtab);
     1.7 -	free(trie);
     1.8 +	delete trie;
     1.9  }
    1.10  
    1.11  bool sm_trie_retrieve(Trie *trie, const char *key, void **value)
    1.12 @@ -424,9 +424,11 @@
    1.13  
    1.14  			if (incoming_base + incoming_limit > trie->baseSize)
    1.15  			{
    1.16 -				incoming_limit = trie->baseSize - incoming_limit;
    1.17 +				incoming_limit = trie->baseSize - incoming_base;
    1.18  			}
    1.19  
    1.20 +			assert(incoming_limit > 0 && incoming_limit <= 255);
    1.21 +
    1.22  			for (unsigned int i=1; i<=255; i++,cur++)
    1.23  			{
    1.24  				if (cur->mode == Node_Arc || cur->mode == Node_Term)
    1.25 @@ -707,6 +709,8 @@
    1.26  
    1.27  				/* Phew! */
    1.28  				return true;
    1.29 +			} else {
    1.30 +				assert(node->mode == Node_Arc);
    1.31  			}
    1.32  		}
    1.33  		lastidx = curidx;