From 9733adc9cbd1b8e8c53297cc88a007fe36bd8da4 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 23 Mar 2017 15:39:49 +0100 Subject: [PATCH] Check array access in MatrixFree::cell_loop --- include/deal.II/matrix_free/matrix_free.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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); } -- 2.39.5