Skip to content

Counter never incremented in an do-while loop — infinite loop risk (HVACVariableRefrigerantFlow.cc) #11556

@dareumnam

Description

@dareumnam

Issue overview

In HVACVariableRefrigerantFlow.cc, the do-while loop to calculate Ncomp has a max iteration guard Counter >= 30, but Counter is initialized to 1 and never incremented inside the loop here.
The adjacent similar block already does this correctly with Counter = Counter + 1, this block is just missing the same line.
This also fixes a CppCheck knownConditionTrueFalse warning at HVACVariableRefrigerantFlow.cc:11383, where Counter >= 30 is flagged as always false.

Operating System (Multiple choices)

Windows

Operating System Version

11

Version of EnergyPlus

26.1.0

Unmethours link or helpdesk ticket number

N/A

Defect file

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    DefectIncludes code to repair a defect in EnergyPlus

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions