From 6756084cef1fdb0dbf3fa52dba6133c5bcc29d55 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Mon, 21 Dec 2015 00:42:56 -0500 Subject: [PATCH] fix uninitialized members in SparseMatrixEZ An uninitialized member would cause random crashes in tests/lac/sparse_matrices_ez as documented by valgrind: ==31301== Conditional jump or move depends on uninitialised value(s) ==31301== at 0xB0C4614: dealii::SparseMatrixEZ::reinit(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) (stl_vector.h:666) ==31301== by 0x40F45C: main (sparse_matrix_ez.h:1400) --- include/deal.II/lac/sparse_matrix_ez.h | 2 +- include/deal.II/lac/sparse_matrix_ez.templates.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/deal.II/lac/sparse_matrix_ez.h b/include/deal.II/lac/sparse_matrix_ez.h index 153b5a8ede..131fd5b453 100644 --- a/include/deal.II/lac/sparse_matrix_ez.h +++ b/include/deal.II/lac/sparse_matrix_ez.h @@ -86,7 +86,7 @@ template class FullMatrix; * If the rows are expected to be filled more or less from first to last, * using a @p default_row_length of zero may not be such a bad idea. * - * The name of this matrix is in reverence to a publication of the Internal + * The name of this matrix is in reference to a publication of the Internal * Revenue Service of the United States of America. I hope some other aliens * will appreciate it. By the way, the suffix makes sense by pronouncing it * the American way. diff --git a/include/deal.II/lac/sparse_matrix_ez.templates.h b/include/deal.II/lac/sparse_matrix_ez.templates.h index bacd822d5c..db928932d3 100644 --- a/include/deal.II/lac/sparse_matrix_ez.templates.h +++ b/include/deal.II/lac/sparse_matrix_ez.templates.h @@ -31,9 +31,10 @@ DEAL_II_NAMESPACE_OPEN template SparseMatrixEZ::SparseMatrixEZ() -{ - n_columns = 0; -} + : n_columns (0), + increment (1), + saved_default_row_length (0) +{} template -- 2.39.5