From: simonmar Date: Fri, 15 Dec 2000 17:07:20 +0000 (+0000) Subject: [project @ 2000-12-15 17:07:20 by simonmar] X-Git-Tag: Approximately_9120_patches~3088 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=9afd8f179180a8b463ed95b799bb941e9ea243ee;p=ghc-hetmet.git [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. --- diff --git a/ghc/compiler/codeGen/CgCon.lhs b/ghc/compiler/codeGen/CgCon.lhs index 9b22fcc..e09c085 100644 --- a/ghc/compiler/codeGen/CgCon.lhs +++ b/ghc/compiler/codeGen/CgCon.lhs @@ -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