Commit 9afd8f17 authored by simonmar's avatar simonmar
Browse files

[project @ 2000-12-15 17:07:20 by simonmar]

ASSERT that we have the right number of arguments when building a
constructor, to avoid repeats of today's extended debugging session.
parent 858c90df
......@@ -45,7 +45,8 @@ import ClosureInfo ( mkConLFInfo, mkLFArgument,
import CostCentre ( currentOrSubsumedCCS, dontCareCCS, CostCentreStack,
currentCCS )
import DataCon ( DataCon, dataConName, dataConTag,
isUnboxedTupleCon, isNullaryDataCon, dataConId, dataConWrapId
isUnboxedTupleCon, isNullaryDataCon, dataConId,
dataConWrapId, dataConRepArity
)
import Id ( Id, idName, idPrimRep )
import Literal ( Literal(..) )
......@@ -69,6 +70,7 @@ cgTopRhsCon :: Id -- Name of thing bound to this RHS
-> FCode (Id, CgIdInfo)
cgTopRhsCon id con args
= ASSERT(not (isDllConApp con args)) -- checks for litlit args too
ASSERT(length args == dataConRepArity con)
let
name = idName id
closure_label = mkClosureLabel name
......@@ -269,7 +271,8 @@ sure the @amodes@ passed don't conflict with each other.
cgReturnDataCon :: DataCon -> [CAddrMode] -> Code
cgReturnDataCon con amodes
= getEndOfBlockInfo `thenFC` \ (EndOfBlockInfo args_sp sequel) ->
= ASSERT(length amodes == dataConRepArity con)
getEndOfBlockInfo `thenFC` \ (EndOfBlockInfo args_sp sequel) ->
case sequel of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment