Skip to content
Snippets Groups Projects
Commit b9bef8d6 authored by Simon Marlow's avatar Simon Marlow
Browse files

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

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