diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-16 15:01:32 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-16 15:01:32 +0300 |
commit | 978b0bbcedb3ae449b417dc0fd45a739b5042131 (patch) | |
tree | 2c5207a1a9b9e9aff07bba4f9de4f02c15ce370e /moses/ConfusionNet.cpp | |
parent | 31338d2fa211046e595efc22177326e165204d36 (diff) |
change InputFeature::Instance to return pointer, not ref. Strange segfault in OSX/clang
Diffstat (limited to 'moses/ConfusionNet.cpp')
-rw-r--r-- | moses/ConfusionNet.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/moses/ConfusionNet.cpp b/moses/ConfusionNet.cpp index 16db99c44..671f0d166 100644 --- a/moses/ConfusionNet.cpp +++ b/moses/ConfusionNet.cpp @@ -70,7 +70,7 @@ ConfusionNet() : InputType() if (SD.IsSyntax()) { m_defaultLabelSet.insert(SD.GetInputDefaultNonTerminal()); } - UTIL_THROW_IF2(&InputFeature::Instance() == NULL, "Input feature must be specified"); + UTIL_THROW_IF2(InputFeature::InstancePtr() == NULL, "Input feature must be specified"); } ConfusionNet:: @@ -140,9 +140,9 @@ ReadFormat0(std::istream& in, const std::vector<FactorType>& factorOrder) Clear(); // const StaticData &staticData = StaticData::Instance(); - const InputFeature &inputFeature = InputFeature::Instance(); - size_t numInputScores = inputFeature.GetNumInputScores(); - size_t numRealWordCount = inputFeature.GetNumRealWordsInInput(); + const InputFeature *inputFeature = InputFeature::InstancePtr(); + size_t numInputScores = inputFeature->GetNumInputScores(); + size_t numRealWordCount = inputFeature->GetNumRealWordsInInput(); size_t totalCount = numInputScores + numRealWordCount; bool addRealWordCount = (numRealWordCount > 0); |