Skip to content

Commit bd55ef3

Browse files
jhlegarretahjmjohnson
authored andcommitted
BUG: Initialize itk::ExhaustiveOptimizer ivars
Initialize `itk::ExhaustiveOptimizer` ivars. Fixes: ``` UMR ==19790== Use of uninitialised value of size 8 ==19790== at 0x64AD10B: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28) ==19790== by 0x64AD7AD: std::ostreambuf_iterator > std::num_put > > ::_M_insert_int(std::ostreambuf_iterator >, std::ios_base&, char, unsigned long) const (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28) ==19790== by 0x64BC00E: std::ostream& std::ostream::_M_insert(unsigned long) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28) ==19790== by 0x489F39F: itk::ExhaustiveOptimizer::PrintSelf(std::ostream&, itk::Indent) const (itkExhaustiveOptimizer.cxx:227) ==19790== by 0x535CB19: itk::LightObject::Print(std::ostream&, itk::Indent) const (itkLightObject.cxx:125) ==19790== by 0x164F7E: itkExhaustiveOptimizerTest(int, char**) (itkExhaustiveOptimizerTest.cxx:158) ==19790== by 0x12F2E7: main (ITKOptimizersTestDriver.cxx:222) ``` Raised for example in: https://open.cdash.org/viewDynamicAnalysisFile.php?id=9067994
1 parent c935325 commit bd55ef3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/Numerics/Optimizers/include/itkExhaustiveOptimizer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ class ITKOptimizers_EXPORT ExhaustiveOptimizer : public SingleValuedNonLinearOpt
154154

155155
ParametersType m_CurrentIndex;
156156

157-
SizeValueType m_MaximumNumberOfIterations;
157+
SizeValueType m_MaximumNumberOfIterations{ 1 };
158158

159-
MeasureType m_MaximumMetricValue;
159+
MeasureType m_MaximumMetricValue{ itk::NumericTraits<MeasureType>::max() };
160160

161161
MeasureType m_MinimumMetricValue;
162162

0 commit comments

Comments
 (0)