diff options
-rw-r--r-- | src/interpolate.c | 4 | ||||
-rw-r--r-- | src/rotatingsymmetry90.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/interpolate.c b/src/interpolate.c index 80a11c1..30a18f8 100644 --- a/src/interpolate.c +++ b/src/interpolate.c @@ -455,7 +455,7 @@ Rot90_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_, /* Copy coordinates */ for (d=0; d<DIM; ++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]); } /* Fold coordinates */ @@ -487,7 +487,7 @@ Rot90_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_, assert (new_output_arrays); for (m=0; m<N_output_arrays; ++m) { new_output_arrays[m] = malloc (N_interp_points * sizeof(CCTK_REAL)); - assert (new_output_arrays[m]); + assert (N_interp_points == 0 || new_output_arrays[m]); } diff --git a/src/rotatingsymmetry90.c b/src/rotatingsymmetry90.c index 8e89689..51150c4 100644 --- a/src/rotatingsymmetry90.c +++ b/src/rotatingsymmetry90.c @@ -594,6 +594,8 @@ void Rot90_ApplyBC (CCTK_ARGUMENTS) nvars = Boundary_SelectedGVs (cctkGH, 0, 0, 0, 0, 0, 0); assert (nvars>=0); + if (nvars==0) return; + indices = malloc (nvars * sizeof *indices); assert (indices); faces = malloc (nvars * sizeof *faces); |