From c00f42458fe7c23bf01ca2885f0e18313d44b514 Mon Sep 17 00:00:00 2001 From: Daniel Bergman Date: Wed, 19 Aug 2026 10:42:13 -0400 Subject: [PATCH] Initialize loop counter in intialize_hypothesis_rulesets The loop over cell_definitions_by_index declared `int n` without an initializer, so the loop started from an indeterminate value. Depending on the garbage value, this could skip creating hypothesis rulesets for some or all cell definitions, or index out of range. Every sibling loop in this file already uses `int n=0`. Co-Authored-By: Claude Opus 5 --- core/PhysiCell_rules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/PhysiCell_rules.cpp b/core/PhysiCell_rules.cpp index c516244b4..bed76bc9c 100644 --- a/core/PhysiCell_rules.cpp +++ b/core/PhysiCell_rules.cpp @@ -885,7 +885,7 @@ void intialize_hypothesis_rulesets( void ) { hypothesis_rulesets.clear(); // empty(); - for( int n; n < cell_definitions_by_index.size() ; n++ ) + for( int n=0; n < cell_definitions_by_index.size() ; n++ ) { Cell_Definition* pCD = cell_definitions_by_index[n]; add_hypothesis_ruleset(pCD);