diff --git a/CarpetX/src/driver.cxx b/CarpetX/src/driver.cxx index d8a8debac..5859bd7d1 100644 --- a/CarpetX/src/driver.cxx +++ b/CarpetX/src/driver.cxx @@ -1,3 +1,4 @@ +#pragma GCC optimize("O0") #include "driver.hxx" #include "boundaries.hxx" diff --git a/CarpetX/src/driver.hxx b/CarpetX/src/driver.hxx index def917d48..1eeb54730 100644 --- a/CarpetX/src/driver.hxx +++ b/CarpetX/src/driver.hxx @@ -251,11 +251,21 @@ struct GHExt { int typesize() const { return _typesize; }; const void *data_at(size_t i) const { +#ifdef CCTK_DEBUG + if (i >= _count) { + CCTK_VERROR("invalid index %zd exceeds %zd", i, _count); + } +#endif assert(i < _count); return (char *)_data + i * _typesize; }; void *data_at(size_t i) { +#ifdef CCTK_DEBUG + if (i >= _count) { + CCTK_VERROR("invalid index %zu exceeds %zu", i, _count); + } +#endif assert(i < _count); return (char *)_data + i * _typesize; };