Commit b9bef8d6 authored by simonm's avatar simonm
Browse files

[project @ 1999-04-27 15:21:32 by simonm]

off-by-one in folding of tagToEnum#.
parent e0955d95
......@@ -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}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment