mirror of https://github.com/explosion/spaCy.git
* Initialize StateC._empty_token to 0, to avoid undefined behaviour.
This commit is contained in:
parent
1b41f868d2
commit
4412a70dc5
|
@ -8,7 +8,6 @@ from ..symbols cimport punct
|
||||||
from ..attrs cimport IS_SPACE
|
from ..attrs cimport IS_SPACE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cdef cppclass StateC:
|
cdef cppclass StateC:
|
||||||
int* _stack
|
int* _stack
|
||||||
int* _buffer
|
int* _buffer
|
||||||
|
@ -48,6 +47,7 @@ cdef cppclass StateC:
|
||||||
this._e_i = 0
|
this._e_i = 0
|
||||||
for i in range(length):
|
for i in range(length):
|
||||||
this._buffer[i] = i
|
this._buffer[i] = i
|
||||||
|
memset(&this._empty_token, 0, sizeof(TokenC))
|
||||||
this._empty_token.lex = &EMPTY_LEXEME
|
this._empty_token.lex = &EMPTY_LEXEME
|
||||||
for i in range(length):
|
for i in range(length):
|
||||||
this._sent[i] = sent[i]
|
this._sent[i] = sent[i]
|
||||||
|
|
Loading…
Reference in New Issue