From 9afd8f179180a8b463ed95b799bb941e9ea243ee Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 15 Dec 2000 17:07:20 +0000 Subject: [PATCH] [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. --- ghc/compiler/codeGen/CgCon.lhs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 1.7.10.4