Fix division-by-zero crash
Not clear why step_->jobsets was empty...
This commit is contained in:
parent
1ff48da3d3
commit
d8d188301d
|
@ -136,10 +136,12 @@ bool State::doBuildStep(std::shared_ptr<StoreAPI> store, Step::ptr step,
|
||||||
among the jobsets that depend on it. */
|
among the jobsets that depend on it. */
|
||||||
{
|
{
|
||||||
auto step_(step->state.lock());
|
auto step_(step->state.lock());
|
||||||
// FIXME: loss of precision.
|
if (!step_->jobsets.empty()) {
|
||||||
time_t charge = (result.stopTime - result.startTime) / step_->jobsets.size();
|
// FIXME: loss of precision.
|
||||||
for (auto & jobset : step_->jobsets)
|
time_t charge = (result.stopTime - result.startTime) / step_->jobsets.size();
|
||||||
jobset->addStep(result.startTime, charge);
|
for (auto & jobset : step_->jobsets)
|
||||||
|
jobset->addStep(result.startTime, charge);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Asynchronously compress the log. */
|
/* Asynchronously compress the log. */
|
||||||
|
|
Loading…
Reference in a new issue