Skip to content

Commit b1bd66b

Browse files
authored
Table::copy: add assertion (#5350)
1 parent 4ce1806 commit b1bd66b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Src/Base/AMReX_TableData.H

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,8 @@ void
627627
TableData<T,N,ORDER>::copy (TableData<T,N,ORDER> const& rhs) noexcept
628628
{
629629
std::size_t count = sizeof(T)*size();
630+
if (count == 0) { return; }
631+
AMREX_ASSERT(count == sizeof(T)*rhs.size());
630632
#ifdef AMREX_USE_GPU
631633
bool this_on_device = arena()->isManaged() || arena()->isDevice();
632634
bool rhs_on_device = rhs.arena()->isManaged() || rhs.arena()->isDevice();

0 commit comments

Comments
 (0)