From 575a18eed250669876ddf225cf8050e691eedd75 Mon Sep 17 00:00:00 2001 From: Mike Solomon Date: Mon, 4 Apr 2011 10:41:08 -0400 Subject: [PATCH] Adds programming error for empty config vector in beam-quanting.cc. This avoids a segmentation fault when the queue.top () is called. --- lily/beam-quanting.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index e868e51d7f..e1116308ed 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -447,6 +447,12 @@ Beam_scoring_problem::solve () const { vector configs; generate_quants (&configs); + if (configs.empty ()) + { + programming_error ("No viable beam quanting found. Using unquanted y value."); + return unquanted_y; + } + Beam_configuration *best = NULL; bool debug = -- 2.39.2