Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/moses
diff options
context:
space:
mode:
authorshuoyangd <shuoyangd@gmail.com>2017-03-23 04:38:24 +0300
committershuoyangd <shuoyangd@gmail.com>2017-03-23 04:38:24 +0300
commitb51c5668f54c53e1226435d8fd7dcba235e9b3c9 (patch)
tree083a48b377585a56335fdd6f7e1d635c10d27cbb /moses
parent7df9726788cc03a90a6ebaf04de1c1aea7ddc2f5 (diff)
fix segfault in StaticData.cpp
Diffstat (limited to 'moses')
-rw-r--r--moses/StaticData.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/moses/StaticData.cpp b/moses/StaticData.cpp
index 4d3e96000..6cf000c53 100644
--- a/moses/StaticData.cpp
+++ b/moses/StaticData.cpp
@@ -423,8 +423,14 @@ LoadDecodeGraphsOld(const vector<string> &mappingVector,
if (m_decodeGraphs.size() < decodeGraphInd + 1) {
DecodeGraph *decodeGraph;
if (is_syntax(m_options->search.algo)) {
- size_t maxChartSpan = (decodeGraphInd < maxChartSpans.size()) ? maxChartSpans[decodeGraphInd] : DEFAULT_MAX_CHART_SPAN;
- VERBOSE(1,"max-chart-span: " << maxChartSpans[decodeGraphInd] << endl);
+ size_t maxChartSpan;
+ if (decodeGraphInd < maxChartSpans.size()) {
+ maxChartSpan = maxChartSpans[decodeGraphInd];
+ VERBOSE(1,"max-chart-span: " << maxChartSpans[decodeGraphInd] << endl);
+ }
+ else {
+ maxChartSpan = DEFAULT_MAX_CHART_SPAN;
+ }
decodeGraph = new DecodeGraph(m_decodeGraphs.size(), maxChartSpan);
} else {
decodeGraph = new DecodeGraph(m_decodeGraphs.size());