From: Matthias Maier Date: Mon, 22 Apr 2019 19:18:45 +0000 (-0500) Subject: avoid a segmentation fault X-Git-Tag: v9.1.0-rc1~190^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aae1a0580b896086c557856b9eafa6d5534d5351;p=dealii.git avoid a segmentation fault --- diff --git a/source/lac/dynamic_sparsity_pattern.cc b/source/lac/dynamic_sparsity_pattern.cc index cb93d1a37d..b96163570f 100644 --- a/source/lac/dynamic_sparsity_pattern.cc +++ b/source/lac/dynamic_sparsity_pattern.cc @@ -360,6 +360,11 @@ DynamicSparsityPattern::exists(const size_type i, const size_type j) const Assert(j < cols, ExcIndexRange(j, 0, cols)); Assert(rowset.size() == 0 || rowset.is_element(i), ExcInternalError()); + // Avoid a segmentation fault in below code if the row index happens to + // not be present in the IndexSet rowset: + if (!(rowset.size() == 0 || rowset.is_element(i))) + return false; + if (!have_entries) return false;