summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm/Env.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/StgToCmm/Env.hs')
-rw-r--r--compiler/GHC/StgToCmm/Env.hs11
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/GHC/StgToCmm/Env.hs b/compiler/GHC/StgToCmm/Env.hs
index 3ad42fd19d..ebfff0185f 100644
--- a/compiler/GHC/StgToCmm/Env.hs
+++ b/compiler/GHC/StgToCmm/Env.hs
@@ -136,12 +136,15 @@ getCgIdInfo id
let name = idName id
; if isExternalName name then
let ext_lbl
- | isUnliftedType (idType id) =
+ | isBoxedType (idType id)
+ = mkClosureLabel name $ idCafInfo id
+ | isUnliftedType (idType id)
-- An unlifted external Id must refer to a top-level
-- string literal. See Note [Bytes label] in "GHC.Cmm.CLabel".
- ASSERT( idType id `eqType` addrPrimTy )
- mkBytesLabel name
- | otherwise = mkClosureLabel name $ idCafInfo id
+ = ASSERT( idType id `eqType` addrPrimTy )
+ mkBytesLabel name
+ | otherwise
+ = pprPanic "GHC.StgToCmm.Env: label not found" (ppr id <+> dcolon <+> ppr (idType id))
in return $
litIdInfo platform id (mkLFImported id) (CmmLabel ext_lbl)
else