Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit 544cdeb

Browse files
committed
attempt 2: ignore cvode
1 parent 144875d commit 544cdeb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/codegen/codegen_helper_visitor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,12 @@ void CodegenHelperVisitor::check_cvode_codegen(const ast::Program& node) {
218218
});
219219
});
220220

221+
const auto& cvode_nodes = collect_nodes(*breakpoint_node, {AstNodeType::CVODE_BLOCK});
222+
221223
// only case when we emit CVODE code is if we have exactly one block, and
222224
// that block is either a KINETIC/DERIVATIVE with any method, or a
223225
// PROCEDURE with `after_cvode` method
224-
if (solve_nodes.size() == 1 && (kinetic_or_derivative_nodes.size() || using_cvode)) {
226+
if (solve_nodes.size() == 1 && !cvode_nodes.empty() && (kinetic_or_derivative_nodes.size() || using_cvode)) {
225227
logger->debug("Will emit code for CVODE");
226228
info.emit_cvode = true;
227229
}

0 commit comments

Comments
 (0)