From: simonm Date: Tue, 27 Apr 1999 15:21:32 +0000 (+0000) Subject: [project @ 1999-04-27 15:21:32 by simonm] X-Git-Tag: Approximately_9120_patches~6288 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b9bef8d6cdb65008b10ee6d2a8638ad5575465da;p=ghc-hetmet.git [project @ 1999-04-27 15:21:32 by simonm] off-by-one in folding of tagToEnum#. --- diff --git a/ghc/compiler/simplCore/ConFold.lhs b/ghc/compiler/simplCore/ConFold.lhs index 1dfaf82..e6f4be7 100644 --- a/ghc/compiler/simplCore/ConFold.lhs +++ b/ghc/compiler/simplCore/ConFold.lhs @@ -104,7 +104,7 @@ tryPrimOp TagToEnumOp [Type ty, Con (Literal (MachInt i _)) _] | otherwise = panic "tryPrimOp: tagToEnum# on non-enumeration type" where tag = fromInteger i constrs = tyConDataCons tycon - (dc:_) = [ dc | dc <- constrs, tag == dataConTag dc ] + (dc:_) = [ dc | dc <- constrs, tag == dataConTag dc - fIRST_TAG ] (Just (tycon,_)) = splitTyConApp_maybe ty \end{code}