Skip to content

Fix uninitialized loop counter in intialize_hypothesis_rulesets - #433

Open
drbergman wants to merge 1 commit into
MathCancer:developmentfrom
drbergman:fix-uninitialized-ruleset-loop-counter
Open

Fix uninitialized loop counter in intialize_hypothesis_rulesets#433
drbergman wants to merge 1 commit into
MathCancer:developmentfrom
drbergman:fix-uninitialized-ruleset-loop-counter

Conversation

@drbergman

@drbergman drbergman commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

In intialize_hypothesis_rulesets (core/PhysiCell_rules.cpp), the loop counter is declared without an initializer:

for( int n; n < cell_definitions_by_index.size() ; n++ )

this fixes that

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 <noreply@anthropic.com>
@drbergman
drbergman marked this pull request as ready for review August 19, 2026 16:08
Copilot AI lite review requested due to automatic review settings August 19, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants