Don't attempt to constant-fold empty arrays
This commit is contained in:
parent
e701088469
commit
576c31aa72
|
@ -58,6 +58,8 @@ simplifyExpression ps e
|
|||
|
||||
--{{{ expression evaluator
|
||||
evalLiteral :: A.Expression -> EvalM OccValue
|
||||
evalLiteral (A.Literal _ _ (A.ArrayLiteral _ []))
|
||||
= throwError "empty array"
|
||||
evalLiteral (A.Literal _ _ (A.ArrayLiteral _ aes))
|
||||
= liftM OccArray (mapM evalLiteralArray aes)
|
||||
evalLiteral l = evalSimpleLiteral l
|
||||
|
|
|
@ -316,6 +316,7 @@ data BytesInResult =
|
|||
BIJust Int -- ^ Just that many bytes.
|
||||
| BIOneFree Int Int -- ^ An array type; A bytes, times unknown dimension B.
|
||||
| BIUnknown -- ^ No idea.
|
||||
deriving (Show, Eq)
|
||||
|
||||
-- | Return the size in bytes of a data type.
|
||||
bytesInType :: (PSM m, Die m) => A.Type -> m BytesInResult
|
||||
|
|
Loading…
Reference in New Issue
Block a user