From 4412a70dc5b8b6fb17a811049f0ecbac64a0c3e1 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 6 Feb 2016 13:34:38 +0100 Subject: [PATCH] * Initialize StateC._empty_token to 0, to avoid undefined behaviour. --- spacy/syntax/_state.pxd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/syntax/_state.pxd b/spacy/syntax/_state.pxd index 933ecca3e..c78336a00 100644 --- a/spacy/syntax/_state.pxd +++ b/spacy/syntax/_state.pxd @@ -8,7 +8,6 @@ from ..symbols cimport punct from ..attrs cimport IS_SPACE - cdef cppclass StateC: int* _stack int* _buffer @@ -48,6 +47,7 @@ cdef cppclass StateC: this._e_i = 0 for i in range(length): this._buffer[i] = i + memset(&this._empty_token, 0, sizeof(TokenC)) this._empty_token.lex = &EMPTY_LEXEME for i in range(length): this._sent[i] = sent[i]