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:
abfa45f
)
Missing coercion case in byte code generation
author
Simon Peyton Jones
<simonpj@microsoft.com>
Fri, 6 May 2011 14:35:07 +0000
(15:35 +0100)
committer
Simon Peyton Jones
<simonpj@microsoft.com>
Fri, 6 May 2011 14:35:07 +0000
(15:35 +0100)
compiler/ghci/ByteCodeGen.lhs
patch
|
blob
|
history
diff --git
a/compiler/ghci/ByteCodeGen.lhs
b/compiler/ghci/ByteCodeGen.lhs
index
b1d4bd7
..
c07073a
100644
(file)
--- a/
compiler/ghci/ByteCodeGen.lhs
+++ b/
compiler/ghci/ByteCodeGen.lhs
@@
-1198,6
+1198,9
@@
pushAtom d p e
| Just e' <- bcView e
= pushAtom d p e'
| Just e' <- bcView e
= pushAtom d p e'
+pushAtom _ _ (AnnCoercion {}) -- Coercions are zero-width things,
+ = return (nilOL, 0) -- treated just like a variable VoidArg
+
pushAtom d p (AnnVar v)
| idCgRep v == VoidArg
= return (nilOL, 0)
pushAtom d p (AnnVar v)
| idCgRep v == VoidArg
= return (nilOL, 0)
@@
-1271,9
+1274,6
@@
pushAtom _ _ (AnnLit lit)
-- Get the addr on the stack, untaggedly
return (unitOL (PUSH_UBX (Right addr) 1), 1)
-- Get the addr on the stack, untaggedly
return (unitOL (PUSH_UBX (Right addr) 1), 1)
-pushAtom d p (AnnCast e _)
- = pushAtom d p (snd e)
-
pushAtom _ _ expr
= pprPanic "ByteCodeGen.pushAtom"
(pprCoreExpr (deAnnotate (undefined, expr)))
pushAtom _ _ expr
= pprPanic "ByteCodeGen.pushAtom"
(pprCoreExpr (deAnnotate (undefined, expr)))
@@
-1464,6
+1464,7
@@
bcView _ = Nothing
isVoidArgAtom :: AnnExpr' Var ann -> Bool
isVoidArgAtom e | Just e' <- bcView e = isVoidArgAtom e'
isVoidArgAtom (AnnVar v) = typePrimRep (idType v) == VoidRep
isVoidArgAtom :: AnnExpr' Var ann -> Bool
isVoidArgAtom e | Just e' <- bcView e = isVoidArgAtom e'
isVoidArgAtom (AnnVar v) = typePrimRep (idType v) == VoidRep
+isVoidArgAtom (AnnCoercion {}) = True
isVoidArgAtom _ = False
atomPrimRep :: AnnExpr' Id ann -> PrimRep
isVoidArgAtom _ = False
atomPrimRep :: AnnExpr' Id ann -> PrimRep