google / cld3

Apache License 2.0
776 stars 109 forks source link

Calling detect_language_mixed on an empty string crashes the R session #39

Open bluebear94 opened 4 years ago

bluebear94 commented 4 years ago

To reproduce:

library(cld3)
detect_language_mixed("")

Expected: this produces some result

Actual: R crashes with the following messages:

> detect_language_mixed("")

 *** caught illegal operation ***
address 0x7f6807716e58, cause 'illegal operand'

Traceback:
 1: cld3_detect_language_mixed(as_string(text, vectorize = FALSE),     size)
 2: detect_language_mixed("")
oock commented 4 years ago

To reproduce:

library(cld3)
detect_language_mixed("")

Expected: this produces some result

Actual: R crashes with the following messages:

> detect_language_mixed("")

 *** caught illegal operation ***
address 0x7f6807716e58, cause 'illegal operand'

Traceback:
 1: cld3_detect_language_mixed(as_string(text, vectorize = FALSE),     size)
 2: detect_language_mixed("")