diff options
author | simonmar <unknown> | 2000-12-15 17:07:20 +0000 |
---|---|---|
committer | simonmar <unknown> | 2000-12-15 17:07:20 +0000 |
commit | 9afd8f179180a8b463ed95b799bb941e9ea243ee (patch) | |
tree | c65a08474be9777cb7c99e65242352c6a40b59c7 /ghc/compiler/codeGen | |
parent | 858c90dfbad05e455065eb33afb7cfd6d9b4f8ae (diff) | |
download | haskell-9afd8f179180a8b463ed95b799bb941e9ea243ee.tar.gz |
[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.
Diffstat (limited to 'ghc/compiler/codeGen')
-rw-r--r-- | ghc/compiler/codeGen/CgCon.lhs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ghc/compiler/codeGen/CgCon.lhs b/ghc/compiler/codeGen/CgCon.lhs index 9b22fcc221..e09c085ff4 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 |