A list for the developers of CellML tools

Text archives Help


[cellml-dev] FW: r2129 - CellML_DOM_API/trunk/CCGS/sources


Chronological Thread 
  • From: r.britten at auckland.ac.nz (Randall Britten)
  • Subject: [cellml-dev] FW: r2129 - CellML_DOM_API/trunk/CCGS/sources
  • Date: Thu, 13 Mar 2008 18:02:12 +1300

Hi Justin

I would suggest adding a test to the unit-tests for this. I.e. a test that
fails prior to the patch, and passes after the patch.

Regards,
Randall


> -----Original Message-----
> From: automated-notifications-bounces at cellml.org [mailto:automated-
> notifications-bounces at cellml.org] On Behalf Of CellML Automated
> Notifications
> Sent: Thursday, 13 March 2008 5:51 p.m.
> To: automated-notifications at cellml.org
> Subject: r2129 - CellML_DOM_API/trunk/CCGS/sources
>
> Author: jmar150
> Date: 2008-03-13 17:51:12 +1300 (Thu, 13 Mar 2008)
> New Revision: 2129
>
> Modified:
> CellML_DOM_API/trunk/CCGS/sources/CCGSGenerator.cpp
> Log:
> This fixes a potential problem where, if a model was unsuitably
> constrained, and had an
> initial value assignment to a variable that depended upon some other
> variable which was not
> yet defined, a null pointer deref would occur, as there would be an
> unused edge with NULL
> mMaths, and we want to add ref all the maths of all the unused edges.
>
>
>
> Modified: CellML_DOM_API/trunk/CCGS/sources/CCGSGenerator.cpp
> ===================================================================
> --- CellML_DOM_API/trunk/CCGS/sources/CCGSGenerator.cpp 2008-03-12
> 22:40:54 UTC (rev 2128)
> +++ CellML_DOM_API/trunk/CCGS/sources/CCGSGenerator.cpp 2008-03-13
> 04:51:12 UTC (rev 2129)
> @@ -136,8 +136,13 @@
> for (uel = mUnusedEdges.begin(); uel != mUnusedEdges.end(); uel++)
> {
> iface::mathml_dom::MathMLApplyElement* mae = (*uel)->mMaths;
> - mae->add_ref();
> - mCodeInfo->mFlaggedEquations.push_back(mae);
> + // If there was an initial value that was set to a variable
> which could not
> + // be computed, it will be an unused edge with null mMaths.
> + if (mae != NULL)
> + {
> + mae->add_ref();
> + mCodeInfo->mFlaggedEquations.push_back(mae);
> + }
> }
>
> mCodeInfo->mConstraintLevel =
> iface::cellml_services::UNSUITABLY_CONSTRAINED;
>
> _______________________________________________
> automated-notifications mailing list
> automated-notifications at cellml.org
> http://www.cellml.org/mailman/listinfo/automated-notifications





Archive powered by MHonArc 2.6.18.

Top of page