From: Frederic Suter Date: Tue, 13 Aug 2019 08:07:45 +0000 (+0200) Subject: protect accesses to cnst->cnst_light_ X-Git-Tag: v3.24~197 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/96f0842b8bd315d5ac3df5ffb91bbf321a389d24 protect accesses to cnst->cnst_light_ --- diff --git a/src/kernel/lmm/maxmin.cpp b/src/kernel/lmm/maxmin.cpp index 05bf4b7747..1cc6c4ed6f 100644 --- a/src/kernel/lmm/maxmin.cpp +++ b/src/kernel/lmm/maxmin.cpp @@ -617,7 +617,9 @@ template void System::lmm_solve(CnstList& cnst_list) cnst->cnst_light_ = nullptr; } } else { - cnst->cnst_light_->remaining_over_usage = cnst->remaining_ / cnst->usage_; + if (cnst->cnst_light_) { + cnst->cnst_light_->remaining_over_usage = cnst->remaining_ / cnst->usage_; + } } elem.make_inactive(); } else { @@ -646,10 +648,12 @@ template void System::lmm_solve(CnstList& cnst_list) cnst->cnst_light_ = nullptr; } } else { - cnst->cnst_light_->remaining_over_usage = cnst->remaining_ / cnst->usage_; - xbt_assert(not cnst->active_element_set_.empty(), - "Should not keep a maximum constraint that has no active" - " element! You want to check the maxmin precision and possible rounding effects."); + if (cnst->cnst_light_) { + cnst->cnst_light_->remaining_over_usage = cnst->remaining_ / cnst->usage_; + xbt_assert(not cnst->active_element_set_.empty(), + "Should not keep a maximum constraint that has no active" + " element! You want to check the maxmin precision and possible rounding effects."); + } } } }