diff options
Diffstat (limited to 'src/interpolate.c')
-rw-r--r-- | src/interpolate.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/interpolate.c b/src/interpolate.c index edec57c..7e5f218 100644 --- a/src/interpolate.c +++ b/src/interpolate.c @@ -141,12 +141,10 @@ Rot180_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_, new_faces = faces; new_faces &= ~ (1 << 0); - - /* Copy coordinates */ for (d=0; d<3; ++d) { new_interp_coords[d] = malloc (N_interp_points * sizeof(CCTK_REAL)); - assert (new_interp_coords[d]); + assert (N_interp_points == 0 || new_interp_coords[d]); memcpy (new_interp_coords[d], interp_coords[d], N_interp_points * sizeof(CCTK_REAL)); } @@ -183,7 +181,7 @@ Rot180_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_, /* Find output variable indices */ operand_indices = malloc (N_output_arrays * sizeof *operand_indices); - assert (operand_indices); + assert (N_output_arrays == 0 || operand_indices); ierr = Util_TableGetIntArray (param_table_handle, N_output_arrays, operand_indices, "operand_indices"); if (ierr == UTIL_ERROR_TABLE_NO_SUCH_KEY) { @@ -196,7 +194,7 @@ Rot180_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_, } operation_codes = malloc (N_output_arrays * sizeof *operation_codes); - assert (operation_codes); + assert (N_output_arrays == 0 || operation_codes); ierr = Util_TableGetIntArray (param_table_handle, N_output_arrays, operation_codes, "operation_codes"); if (ierr == UTIL_ERROR_TABLE_NO_SUCH_KEY) { @@ -210,7 +208,7 @@ Rot180_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_, output_array_indices = malloc (N_output_arrays * sizeof *output_array_indices); - assert (output_array_indices); + assert (N_output_arrays == 0 || output_array_indices); for (m=0; m<N_output_arrays; ++m) { assert (operand_indices[m]>=0 && operand_indices[m]<N_input_arrays); output_array_indices[m] = input_array_indices[operand_indices[m]]; |