Fixed a bug in the assignment operator of class vcs_VolPhase
m_numSpecies was used before being updated, which could lead to a segmentation fault when resizing m_formulaMatrix to be M-by-zero.
This commit is contained in:
parent
8f4f72369e
commit
3f3df652c6
1 changed files with 1 additions and 1 deletions
|
|
@ -157,6 +157,7 @@ vcs_VolPhase& vcs_VolPhase::operator=(const vcs_VolPhase& b)
|
||||||
ChargeNeutralityElement = b.ChargeNeutralityElement;
|
ChargeNeutralityElement = b.ChargeNeutralityElement;
|
||||||
p_VCS_UnitsFormat = b.p_VCS_UnitsFormat;
|
p_VCS_UnitsFormat = b.p_VCS_UnitsFormat;
|
||||||
p_activityConvention= b.p_activityConvention;
|
p_activityConvention= b.p_activityConvention;
|
||||||
|
m_numSpecies = b.m_numSpecies;
|
||||||
m_numElemConstraints = b.m_numElemConstraints;
|
m_numElemConstraints = b.m_numElemConstraints;
|
||||||
m_elementNames.resize(b.m_numElemConstraints);
|
m_elementNames.resize(b.m_numElemConstraints);
|
||||||
for (size_t e = 0; e < b.m_numElemConstraints; e++) {
|
for (size_t e = 0; e < b.m_numElemConstraints; e++) {
|
||||||
|
|
@ -172,7 +173,6 @@ vcs_VolPhase& vcs_VolPhase::operator=(const vcs_VolPhase& b)
|
||||||
}
|
}
|
||||||
m_speciesUnknownType = b.m_speciesUnknownType;
|
m_speciesUnknownType = b.m_speciesUnknownType;
|
||||||
m_elemGlobalIndex = b.m_elemGlobalIndex;
|
m_elemGlobalIndex = b.m_elemGlobalIndex;
|
||||||
m_numSpecies = b.m_numSpecies;
|
|
||||||
PhaseName = b.PhaseName;
|
PhaseName = b.PhaseName;
|
||||||
m_totalMolesInert = b.m_totalMolesInert;
|
m_totalMolesInert = b.m_totalMolesInert;
|
||||||
m_isIdealSoln = b.m_isIdealSoln;
|
m_isIdealSoln = b.m_isIdealSoln;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue