Skip to content
Snippets Groups Projects
Commit 260da0d0 authored by Grégoire Kubler's avatar Grégoire Kubler Committed by Maxence Naud
Browse files

fix : added an assert to ensure that specs were effectively retrieved by getAvailableSpecs

otherwise dereferencing bestMatch later on in the function resulted in a segfault
parent 68064166
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,10 @@ Aidge::ImplSpec Aidge::OperatorImpl::getBestMatch(const ImplSpec& requiredSpecs)
Log::debug("getBestMatch() for requirements: {}", requiredSpecs);
const auto availableSpecsSet = getAvailableImplSpecs();
AIDGE_ASSERT(availableSpecsSet.size() > 0 ,
"OperatorImpl::getBestMatch(): No available specs found by"
"getAvailableSpecs(). "
"Cannot find best implementation for required specs, aborting.");
const std::vector<ImplSpec> availableSpecs(availableSpecsSet.begin(), availableSpecsSet.end());
std::vector<int> matchingSpecs(availableSpecs.size(), -1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment