[commit: ghc] master: Reenable a couple of assertions (4faae22)
Ian Lynagh
igloo at earth.li
Tue Sep 27 23:54:51 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/4faae220b30e6ea020ec8e2e9426e6369216f649
>---------------------------------------------------------------
commit 4faae220b30e6ea020ec8e2e9426e6369216f649
Author: Ian Lynagh <igloo at earth.li>
Date: Tue Sep 27 21:07:24 2011 +0100
Reenable a couple of assertions
The comment explaining why they were disabled seemed to be out-of-date.
It claimed we need to be able to write (intToWord# 0xffff0000#) whereas
we can just write 0xffff0000##.
Validate goes through with
GhcStage1HcOpts += -O0 -DDEBUG
GhcStage2HcOpts += -O0 -DDEBUG
>---------------------------------------------------------------
compiler/basicTypes/Literal.lhs | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/compiler/basicTypes/Literal.lhs b/compiler/basicTypes/Literal.lhs
index 8c5d42a..c3840c8 100644
--- a/compiler/basicTypes/Literal.lhs
+++ b/compiler/basicTypes/Literal.lhs
@@ -39,6 +39,8 @@ module Literal
, nullAddrLit, float2DoubleLit, double2FloatLit
) where
+#include "HsVersions.h"
+
import TysPrim
import PrelNames
import Type
@@ -220,16 +222,12 @@ instance Ord Literal where
\begin{code}
-- | Creates a 'Literal' of type @Int#@
mkMachInt :: Integer -> Literal
-mkMachInt x = -- ASSERT2( inIntRange x, integer x )
- -- Not true: you can write out of range Int# literals
- -- For example, one can write (intToWord# 0xffff0000) to
- -- get a particular Word bit-pattern, and there's no other
- -- convenient way to write such literals, which is why we allow it.
+mkMachInt x = ASSERT2( inIntRange x, integer x )
MachInt x
-- | Creates a 'Literal' of type @Word#@
mkMachWord :: Integer -> Literal
-mkMachWord x = -- ASSERT2( inWordRange x, integer x )
+mkMachWord x = ASSERT2( inWordRange x, integer x )
MachWord x
-- | Creates a 'Literal' of type @Int64#@
More information about the Cvs-ghc
mailing list