From: Daniel Arndt Date: Thu, 23 Mar 2017 14:39:49 +0000 (+0100) Subject: Check array access in MatrixFree::cell_loop X-Git-Tag: v8.5.0-rc1~14^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4097%2Fhead;p=dealii.git Check array access in MatrixFree::cell_loop --- diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index 3e9c6b8db5..122ab76bfe 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -2529,9 +2529,11 @@ MatrixFree::cell_loop if (spawn_index_child == -1) worker[spawn_index]->spawn(*blocked_worker[(part-1)/2]); else - worker[spawn_index]->spawn(*worker[spawn_index_child]); + { + Assert(spawn_index_child>=0, ExcInternalError()); + worker[spawn_index]->spawn(*worker[spawn_index_child]); + } spawn_index = spawn_index_new; - spawn_index_child = -2; } else { @@ -2587,7 +2589,10 @@ MatrixFree::cell_loop } } if (evens==odds) - worker[spawn_index]->spawn(*worker[spawn_index_child]); + { + Assert(spawn_index_child>=0, ExcInternalError()); + worker[spawn_index]->spawn(*worker[spawn_index_child]); + } root->wait_for_all(); root->destroy(*root); }