* Fix niggling memory error, which was caused by bug in the way tokens resized their internal vector.

This commit is contained in:
Matthew Honnibal 2014-09-15 02:08:39 +02:00
parent 5dcc1a426a
commit 0f6bf2a2ee

View File

@ -84,7 +84,7 @@ cdef class Tokens:
self.push_back(lexeme._c)
cdef int push_back(self, LexemeC* lexeme) except -1:
if (self.size + 1) == self.length:
if (self.length + 1) == self.size:
self.size *= 2
self.lexemes = <LexemeC**>realloc(self.lexemes, self.size * sizeof(LexemeC*))
self.lexemes[self.length] = lexeme