From 36c0b5de339d1153c76c961b7e6829321d286d06 Mon Sep 17 00:00:00 2001 From: sewardj Date: Mon, 1 Nov 1999 11:01:13 +0000 Subject: [PATCH] [project @ 1999-11-01 11:01:11 by sewardj] Fix codegen bug causing cg028.hs to fail. namePmDouble was not bound to anything, which caused translations of patterns containing doubles to contain NILs. Also bound namePmInteger since it didn't seem to be bound to anything. --- ghc/interpreter/lib/Prelude.hs | 4 ++-- ghc/interpreter/link.c | 36 ++++++++++++++++-------------------- ghc/lib/hugs/Prelude.hs | 4 ++-- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ghc/interpreter/lib/Prelude.hs b/ghc/interpreter/lib/Prelude.hs index bd7374f..1533c07 100644 --- a/ghc/interpreter/lib/Prelude.hs +++ b/ghc/interpreter/lib/Prelude.hs @@ -1533,8 +1533,8 @@ primPmInt n x = fromInt n == x primPmInteger :: Num a => Integer -> a -> Bool primPmInteger n x = fromInteger n == x -primPmFlt :: Fractional a => Double -> a -> Bool -primPmFlt n x = fromDouble n == x +primPmDouble :: Fractional a => Double -> a -> Bool +primPmDouble n x = fromDouble n == x -- ToDo: make the message more informative. primPmFail :: a diff --git a/ghc/interpreter/link.c b/ghc/interpreter/link.c index e9fb95f..ff18e6e 100644 --- a/ghc/interpreter/link.c +++ b/ghc/interpreter/link.c @@ -9,8 +9,8 @@ * included in the distribution. * * $RCSfile: link.c,v $ - * $Revision: 1.10 $ - * $Date: 1999/10/29 00:53:25 $ + * $Revision: 1.11 $ + * $Date: 1999/11/01 11:01:11 $ * ------------------------------------------------------------------------*/ #include "prelude.h" @@ -102,9 +102,6 @@ Name namePmSub; Name namePMFail; Name nameEqChar; Name nameEqInt; -#if !OVERLOADED_CONSTANTS -Name nameEqInteger; -#endif Name nameEqDouble; Name namePmInt; Name namePmInteger; @@ -473,29 +470,28 @@ Void linkPreludeNames(void) { /* Hook to names defined in Prelude */ implementPrim(n); } - nameRunST = linkName("primRunST"); + nameRunST = linkName("primRunST"); /* static(tidyInfix) */ - nameNegate = linkName("negate"); + nameNegate = linkName("negate"); /* user interface */ - nameRunIO = linkName("primRunIO"); - namePrint = linkName("print"); + nameRunIO = linkName("primRunIO"); + namePrint = linkName("print"); /* desugar */ - nameOtherwise = linkName("otherwise"); - nameUndefined = linkName("undefined"); + nameOtherwise = linkName("otherwise"); + nameUndefined = linkName("undefined"); /* pmc */ #if NPLUSK - namePmSub = linkName("primPmSub"); + namePmSub = linkName("primPmSub"); #endif /* translator */ - nameEqChar = linkName("primEqChar"); - nameEqInt = linkName("primEqInt"); -nameCreateAdjThunk = linkName("primCreateAdjThunk"); -#if !OVERLOADED_CONSTANTS - nameEqInteger = linkName("primEqInteger"); -#endif /* !OVERLOADED_CONSTANTS */ - nameEqDouble = linkName("primEqDouble"); - namePmInt = linkName("primPmInt"); + nameEqChar = linkName("primEqChar"); + nameEqInt = linkName("primEqInt"); + nameCreateAdjThunk = linkName("primCreateAdjThunk"); + nameEqDouble = linkName("primEqDouble"); + namePmInt = linkName("primPmInt"); + namePmInteger = linkName("primPmInteger"); + namePmDouble = linkName("primPmDouble"); name(namePmInt).inlineMe = TRUE; } } diff --git a/ghc/lib/hugs/Prelude.hs b/ghc/lib/hugs/Prelude.hs index bd7374f..1533c07 100644 --- a/ghc/lib/hugs/Prelude.hs +++ b/ghc/lib/hugs/Prelude.hs @@ -1533,8 +1533,8 @@ primPmInt n x = fromInt n == x primPmInteger :: Num a => Integer -> a -> Bool primPmInteger n x = fromInteger n == x -primPmFlt :: Fractional a => Double -> a -> Bool -primPmFlt n x = fromDouble n == x +primPmDouble :: Fractional a => Double -> a -> Bool +primPmDouble n x = fromDouble n == x -- ToDo: make the message more informative. primPmFail :: a -- 1.7.10.4