Added a missing sanity check when allocating mobile arrays
This commit is contained in:
parent
d07a4cb496
commit
535054eed0
|
@ -2154,7 +2154,9 @@ cgenSetPri _ e = do tell ["SetPriority(wptr,"]
|
||||||
--{{{ mobiles
|
--{{{ mobiles
|
||||||
cgenAllocMobile :: Meta -> A.Type -> Maybe A.Expression -> CGen()
|
cgenAllocMobile :: Meta -> A.Type -> Maybe A.Expression -> CGen()
|
||||||
cgenAllocMobile m (A.Mobile t@(A.Array ds innerT)) Nothing
|
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)
|
call genBytesIn m innerT (Left False)
|
||||||
tell [",", show $ length ds]
|
tell [",", show $ length ds]
|
||||||
prefixComma $ [call genExpression e | A.Dimension e <- ds]
|
prefixComma $ [call genExpression e | A.Dimension e <- ds]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user