summaryrefslogtreecommitdiff
path: root/rts/PrimOps.cmm
diff options
context:
space:
mode:
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r--rts/PrimOps.cmm4
1 files changed, 3 insertions, 1 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 26568f961d..8932bd6042 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -409,7 +409,9 @@ stg_newArrayArrayzh ( W_ n /* words */ )
StgMutArrPtrs_size(arr) = size;
// Initialize card table to all-clean.
- setCardsValue(arr, 0, n, 0);
+ if (n != 0) {
+ setCardsValue(arr, 0, n, 0);
+ }
// Initialise all elements of the array with a pointer to the new array
p = arr + SIZEOF_StgMutArrPtrs;