Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In allocateSlice, handle empty list of boxes (#3808)
## Summary In `allocateSlice` (which is called by `get_slice_data` in `Src/Base/AMReX_MultiFabUtil.cpp`) handle the case when no intersection is found between the slice and the box array. ## Additional background When no intersection is found, the `boxes` array will be empty which would cause a segfault if the `data` would be accessed. The fix is to return `nullptr` in this case. Also, `get_slice_data` is modified to return `nullptr` in this case as well. ## Checklist The proposed changes: - [x] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate
- Loading branch information