Skip to content

Commit 49d1f56

Browse files
author
Stefan Hoops
committed
Fixed Bug 2178: During compile of COptItem a missing number was accessed for comparison.
1 parent 7c5d18d commit 49d1f56

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

copasi/optimization/COptItem.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ bool COptItem::compile(const std::vector< CCopasiContainer * > listOfContainer)
386386
success = false;
387387
}
388388

389-
if (!mpUpperObject && !mpLowerObject && *mpUpperBound < *mpLowerBound)
389+
// We can only access the lower and upper numbers if the compile succeeded so far.
390+
if (success && !mpUpperObject && !mpLowerObject && *mpUpperBound < *mpLowerBound)
390391
{
391392
CCopasiMessage(CCopasiMessage::ERROR, MCOptimization + 4, *mpLowerBound, *mpUpperBound, mpObject->getObjectDisplayName().c_str());
392393
success = false;

0 commit comments

Comments
 (0)