diff --git a/contrib/other-builds/moses2/LM/KENLM.cpp b/contrib/other-builds/moses2/LM/KENLM.cpp index 97cc2a0a2..2ba43e094 100644 --- a/contrib/other-builds/moses2/LM/KENLM.cpp +++ b/contrib/other-builds/moses2/LM/KENLM.cpp @@ -206,8 +206,9 @@ void KENLM::EvaluateWhenApplied(const Manager &mgr, const std::size_t adjust_end = std::min(end, begin + m_ngram->Order() - 1); std::size_t position = begin; + typename Model::State aux_state; const Model::State *state0 = stateCast.state; - const Model::State *state1; + const Model::State *state1 = &aux_state; const LMCacheValue &val = ScoreAndCache(mgr, *in_state, TranslateID(hypo.GetWord(position))); float score = val.first;