From f412aaab3d10fb82b20a2190f2cb1424959c599a Mon Sep 17 00:00:00 2001 From: redpony Date: Wed, 29 Sep 2010 20:45:48 +0000 Subject: another feature, another POS git-svn-id: https://ws10smt.googlecode.com/svn/trunk@664 ec762483-ff6d-05da-a07a-a48fb63a330f --- decoder/ff.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'decoder/ff.cc') diff --git a/decoder/ff.cc b/decoder/ff.cc index 7bdd21e3..a32c0dcb 100644 --- a/decoder/ff.cc +++ b/decoder/ff.cc @@ -171,7 +171,9 @@ void ModelSet::AddFeaturesToEdge(const SentenceMetadata& smeta, prob_t* combination_cost_estimate) const { edge->reset_info(); context->resize(state_size_); - memset(&(*context)[0], 0, state_size_); + if (state_size_ > 0) { + memset(&(*context)[0], 0, state_size_); + } SparseVector est_vals; // only computed if combination_cost_estimate is non-NULL if (combination_cost_estimate) *combination_cost_estimate = prob_t::One(); for (int i = 0; i < models_.size(); ++i) { -- cgit v1.2.3