From 535054eed00856b232e56532458df209040bf85d Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Wed, 15 Apr 2009 19:36:14 +0000 Subject: [PATCH] Added a missing sanity check when allocating mobile arrays --- backends/GenerateC.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backends/GenerateC.hs b/backends/GenerateC.hs index 8b33fe7..881b3f3 100644 --- a/backends/GenerateC.hs +++ b/backends/GenerateC.hs @@ -2154,7 +2154,9 @@ cgenSetPri _ e = do tell ["SetPriority(wptr,"] --{{{ mobiles cgenAllocMobile :: Meta -> A.Type -> Maybe A.Expression -> CGen() cgenAllocMobile m (A.Mobile t@(A.Array ds innerT)) Nothing - = do tell ["MTAllocDataArray(wptr,"] + | A.UnknownDimension `elem` ds = dieP m "Cannot allocate mobile array with unknown dimension" + | otherwise = + do tell ["MTAllocDataArray(wptr,"] call genBytesIn m innerT (Left False) tell [",", show $ length ds] prefixComma $ [call genExpression e | A.Dimension e <- ds]