Skip to content

Commit

Permalink
Log a critical instead of an assert if we cannot find the block to so…
Browse files Browse the repository at this point in the history
…lved

Otherwise it only segmentation fault in Release
  • Loading branch information
Nicolas Cornu committed Sep 1, 2022
1 parent 60249f1 commit 4d0b572
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/visitors/solve_block_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "ast/all.hpp"
#include "codegen/codegen_naming.hpp"
#include "utils/logger.hpp"
#include "visitor_utils.hpp"

namespace nmodl {
Expand Down Expand Up @@ -42,7 +43,9 @@ ast::SolutionExpression* SolveBlockVisitor::create_solution_expression(
/// find out the block that is going to solved
const auto& block_name = solve_block.get_block_name()->get_node_name();
const auto& solve_node_symbol = symtab->lookup(block_name);
assert(solve_node_symbol != nullptr);
if (solve_node_symbol == nullptr) {
logger->critical("SolveBlockVisitor :: cannot find the block '{}' to solve it", block_name);
}
auto node_to_solve = solve_node_symbol->get_node();

/// in case of derivimplicit method if neuron solver is used (i.e. not sympy) then
Expand Down

0 comments on commit 4d0b572

Please sign in to comment.