From d59c6926c1778482187700fc612e56d651599c57 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 11 Mar 2017 06:58:34 -0600 Subject: [PATCH] I think this fixes the segfault --- spacy/syntax/_state.pxd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/syntax/_state.pxd b/spacy/syntax/_state.pxd index 222c9bed6..c764e877d 100644 --- a/spacy/syntax/_state.pxd +++ b/spacy/syntax/_state.pxd @@ -40,7 +40,9 @@ cdef cppclass StateC: this._ents[i].end = -1 this._sent[i].l_edge = i this._sent[i].r_edge = i - for i in range(length, length + (PADDING * 2)): + for i in range(PADDING): + this._sent[i].lex = &EMPTY_LEXEME + for i in range(length, PADDING): this._sent[i].lex = &EMPTY_LEXEME this._sent += PADDING this._ents += PADDING @@ -59,8 +61,6 @@ cdef cppclass StateC: for i in range(length): this._sent[i] = sent[i] this._buffer[i] = i - for i in range(length, length + 5): - this._sent[i].lex = &EMPTY_LEXEME __dealloc__(): cdef int PADDING = 5