strange assert failure when stack is empty

This commit is contained in:
Hieu Hoang 2014-04-22 19:05:08 +01:00
parent eed865bd35
commit b917ac552f

View File

@ -163,9 +163,14 @@ float ChartTranslationOptionList::GetBestScore(const ChartCellLabel *chartCell)
{
const HypoList *stack = chartCell->GetStack().cube;
assert(stack);
assert(!stack->empty());
const ChartHypothesis &bestHypo = **(stack->begin());
return bestHypo.GetTotalScore();
//assert(!stack->empty());
if (stack->empty()) {
return 0;
}
else {
const ChartHypothesis &bestHypo = **(stack->begin());
return bestHypo.GetTotalScore();
}
}
void ChartTranslationOptionList::Evaluate(const InputType &input, const InputPath &inputPath)