diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-05-23 17:23:31 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-05-23 17:23:31 +0400 |
commit | 234ebf2ea5cf0f50af701564ec0570283dcb20f0 (patch) | |
tree | 6a7590e740f116740b57f320220e8d6dd281df91 /moses/Phrase.cpp | |
parent | b10ecf2b44fb78c2a174446c2fb1b0ba8deb9b99 (diff) |
segfault in edge case where target translation has no words
Diffstat (limited to 'moses/Phrase.cpp')
-rw-r--r-- | moses/Phrase.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/moses/Phrase.cpp b/moses/Phrase.cpp index 7888c1629..ef5d09b23 100644 --- a/moses/Phrase.cpp +++ b/moses/Phrase.cpp @@ -164,8 +164,12 @@ void Phrase::CreateFromString(FactorDirection direction annotatedWordVector.push_back(*it); } - if (annotatedWordVector.size() == 0) + if (annotatedWordVector.size() == 0) { + if (lhs) { + (*lhs) = NULL; + } return; + } // KOMMA|none ART|Def.Z NN|Neut.NotGen.Sg VVFIN|none // to |