]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Check array access in MatrixFree::cell_loop 4097/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 23 Mar 2017 14:39:49 +0000 (15:39 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 23 Mar 2017 14:40:08 +0000 (15:40 +0100)
include/deal.II/matrix_free/matrix_free.h

index 3e9c6b8db50348bff992b64167a2e34a6dc569d3..122ab76bfecd34d57a2dbc5624a8dde5db5aade2 100644 (file)
@@ -2529,9 +2529,11 @@ MatrixFree<dim, Number>::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<dim, Number>::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);
             }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.