aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiener <diener@eec4d7dc-71c2-46d6-addf-10296150bf52>2011-10-21 17:40:04 +0000
committerdiener <diener@eec4d7dc-71c2-46d6-addf-10296150bf52>2011-10-21 17:40:04 +0000
commit2a92e68c1c9dab5d62d8a2663d785325b1661369 (patch)
tree67581681f45054ecc0af92e9d6de7a43256bb156
parent1ebd27541834a0a213349c51f9f9d5da82d03fe1 (diff)
In the IBM compiler malloc returns a null pointer when allocating 0
bytes. This happens when a processor have no points to interpolate and is not an error. The assert statements now takes this case into account. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Cartoon2D/trunk@125 eec4d7dc-71c2-46d6-addf-10296150bf52
-rw-r--r--src/SymInterp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SymInterp.c b/src/SymInterp.c
index 44a3ddd..f3f1997 100644
--- a/src/SymInterp.c
+++ b/src/SymInterp.c
@@ -476,7 +476,7 @@ Cartoon2D_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 (new_interp_coords[d] || N_interp_points==0);
}
/* Fold coordinates */
@@ -499,7 +499,7 @@ Cartoon2D_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 (new_output_arrays[m] || N_interp_points==0);
}