[project @ 2003-01-20 16:24:51 by simonpj]
[ghc-hetmet.git] / ghc / compiler / basicTypes / Literal.lhs
index 1b794a6..f2d09f3 100644 (file)
@@ -289,8 +289,11 @@ litIsDupable (MachStr _) = False
 litIsDupable other      = True
 
 litSize :: Literal -> Int
-       -- used by CoreUnfold.sizeExpr
-litSize (MachStr str) = lengthFS str `div` 4
+-- Used by CoreUnfold.sizeExpr
+litSize (MachStr str) = 1 + (lengthFS str `div` 4)
+       -- Every literal has size at least 1, otherwise
+       --      f "x" 
+       -- might be too small
 litSize _other       = 1
 \end{code}