From: Martin Kronbichler Date: Sat, 10 Nov 2018 21:23:32 +0000 (+0100) Subject: Avoid negative index offsets. X-Git-Tag: v9.1.0-rc1~566^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2494e7c79a3d975b9a6692571e040d026a6919c;p=dealii.git Avoid negative index offsets. --- diff --git a/include/deal.II/matrix_free/dof_info.templates.h b/include/deal.II/matrix_free/dof_info.templates.h index a3400b2b50..2987edf8cd 100644 --- a/include/deal.II/matrix_free/dof_info.templates.h +++ b/include/deal.II/matrix_free/dof_info.templates.h @@ -817,8 +817,11 @@ namespace internal dof_indices[j * ndofs + 1] - dof_indices[j * ndofs]; for (unsigned int k = 0; k < ndofs; ++k) for (unsigned int j = 0; j < n_comp; ++j) - if (dof_indices[j * ndofs + k] != - dof_indices[j * ndofs] + k * offsets[j]) + // the first if case is to avoid negative offsets + // (invalid) + if (dof_indices[j * ndofs + 1] < dof_indices[j * ndofs] || + dof_indices[j * ndofs + k] != + dof_indices[j * ndofs] + k * offsets[j]) { indices_are_interleaved_and_mixed = 0; break;