OOB access in ParticleDensityCloudInCell
Using gcc 10.3, we have the following very nice warning:
/ccs/home/nthompson/vtk-m/vtkm/filter/ParticleDensityCloudInCell.hxx:61:18: warning: array subscript 4 is outside array bounds of ‘vtkm::Vec<long long int, 4> [1]’ [-Warray-bounds]
61 | density.Add(indices[4], value * parametric[0] * parametric[1] * rparametric[2]);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ccs/home/nthompson/vtk-m/vtkm/filter/ParticleDensityCloudInCell.hxx:51:12: note: while referencing ‘indices’
51 | auto indices = cellSet.GetIndices(cellId);
| ^~~~~~~
/ccs/home/nthompson/vtk-m/vtkm/filter/ParticleDensityCloudInCell.hxx:62:18: warning: array subscript 5 is outside array bounds of ‘vtkm::Vec<long long int, 4> [1]’ [-Warray-bounds]
62 | density.Add(indices[5], value * rparametric[0] * parametric[1] * rparametric[2]);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ccs/home/nthompson/vtk-m/vtkm/filter/ParticleDensityCloudInCell.hxx:51:12: note: while referencing ‘indices’
51 | auto indices = cellSet.GetIndices(cellId);
| ^~~~~~~
/ccs/home/nthompson/vtk-m/vtkm/filter/ParticleDensityCloudInCell.hxx:63:18: warning: array subscript 6 is outside array bounds of ‘vtkm::Vec<long long int, 4> [1]’ [-Warray-bounds]
63 | density.Add(indices[6], value * rparametric[0] * rparametric[1] * rparametric[2]);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ccs/home/nthompson/vtk-m/vtkm/filter/ParticleDensityCloudInCell.hxx:51:12: note: while referencing ‘indices’
51 | auto indices = cellSet.GetIndices(cellId);
| ^~~~~~~
/ccs/home/nthompson/vtk-m/vtkm/filter/ParticleDensityCloudInCell.hxx:64:18: warning: array subscript 7 is outside array bounds of ‘vtkm::Vec<long long int, 4> [1]’ [-Warray-bounds]
64 | density.Add(indices[7], value * parametric[0] * rparametric[1] * rparametric[2]);
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/ccs/home/nthompson/vtk-m/vtkm/filter/ParticleDensityCloudInCell.hxx:51:12: note: while referencing ‘indices’
51 | auto indices = cellSet.GetIndices(cellId);
| ^~~~~~~