Skip to content
Snippets Groups Projects
Commit b264ae7c authored by Ben Boeckel's avatar Ben Boeckel
Browse files

PIOAdaptor: initialize the number of cells

If there's something wrong with the receive, we had been using a junk
stack value. At least initialize it to `0` and leave a comment that a
failing `Receive` may be relevant to the code's assumptions.
parent eb8dda85
No related branches found
No related tags found
No related merge requests found
......@@ -1208,7 +1208,7 @@ void PIOAdaptor::create_amr_UG(vtkMultiBlockDataSet* grid)
// On other processors the correct size for the piece is allocated
std::valarray<int> level;
std::valarray<std::valarray<double>> center;
int numberOfCells;
int numberOfCells = 0;
int64_t* cell_daughter;
int* cell_level;
double* cell_center[3];
......@@ -1293,6 +1293,9 @@ void PIOAdaptor::create_amr_UG(vtkMultiBlockDataSet* grid)
}
else
{
// TODO: check `Receive` for errors. It's the only thing that sets
// `numberOfCells` to anything sensible
// (`clang-analyzer-core.uninitialized.NewArraySize`).
this->Controller->Receive(&numberOfCells, 1, 0, this->Impl->mpiTag);
// Allocate space for holding geometry information
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment