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 7b46ac9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/visitors/solve_block_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "ast/all.hpp"
#include "codegen/codegen_naming.hpp"
#include "visitor_utils.hpp"
#include "utils/logger.hpp"

namespace nmodl {
namespace visitor {
Expand Down Expand Up @@ -42,7 +43,10 @@ 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 7b46ac9

Please sign in to comment.