projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0955d9
)
[project @ 1999-04-27 15:21:32 by simonm]
author
simonm
<unknown>
Tue, 27 Apr 1999 15:21:32 +0000
(15:21 +0000)
committer
simonm
<unknown>
Tue, 27 Apr 1999 15:21:32 +0000
(15:21 +0000)
off-by-one in folding of tagToEnum#.
ghc/compiler/simplCore/ConFold.lhs
patch
|
blob
|
history
diff --git
a/ghc/compiler/simplCore/ConFold.lhs
b/ghc/compiler/simplCore/ConFold.lhs
index
1dfaf82
..
e6f4be7
100644
(file)
--- 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}