From: David Wells Date: Wed, 16 Nov 2022 18:30:31 +0000 (-0500) Subject: SparsityPattern: add an assertion in input data. X-Git-Tag: v9.5.0-rc1~844^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dfdfdd0d0cedae493797bc65d3bd28207bfb27f;p=dealii.git SparsityPattern: add an assertion in input data. --- diff --git a/source/lac/sparsity_pattern.cc b/source/lac/sparsity_pattern.cc index 10f0add3e5..8094e9098a 100644 --- a/source/lac/sparsity_pattern.cc +++ b/source/lac/sparsity_pattern.cc @@ -783,6 +783,7 @@ SparsityPattern::add_entries(const size_type row, ForwardIterator end, const bool indices_are_sorted) { + AssertIndexRange(row, n_rows()); if (indices_are_sorted == true) { if (begin != end) @@ -802,6 +803,7 @@ SparsityPattern::add_entries(const size_type row, if (has_larger_entries == false) for (; it != end; ++it) { + AssertIndexRange(*it, n_cols()); if (store_diagonal_first_in_row && *it == row) continue; Assert(k <= rowstart[row + 1],