Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieu@hoang.co.uk>2013-05-23 17:23:31 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-05-23 17:23:31 +0400
commit234ebf2ea5cf0f50af701564ec0570283dcb20f0 (patch)
tree6a7590e740f116740b57f320220e8d6dd281df91 /moses/Phrase.cpp
parentb10ecf2b44fb78c2a174446c2fb1b0ba8deb9b99 (diff)
segfault in edge case where target translation has no words
Diffstat (limited to 'moses/Phrase.cpp')
-rw-r--r--moses/Phrase.cpp6
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