From b7f80939effe9fd8a8f9a1b2fd18816eeb27ee6f Mon Sep 17 00:00:00 2001 From: v4hn Date: Wed, 17 Mar 2021 00:14:02 +0100 Subject: [PATCH] add more asserts to onNewSolution Strictly speaking there is no need for the invariant, but if something violates it a stage computed something it wasn't meant to. --- core/src/container.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/container.cpp b/core/src/container.cpp index 2d5898f2..ececf0dc 100644 --- a/core/src/container.cpp +++ b/core/src/container.cpp @@ -353,7 +353,13 @@ inline void updateStatePrios(const SolutionSequence::container_type& partial_sol } void SerialContainer::onNewSolution(const SolutionBase& current) { + // failures should never trigger this callback assert(!current.isFailure()); + + // states of solution must be active, otherwise this would not have been computed + assert(current.start()->priority().enabled()); + assert(current.end()->priority().enabled()); + auto impl = pimpl(); const Stage* creator = current.creator(); auto& children = impl->children();