Repository : ssh://[email protected]/ghc

On branch  : master
Link       : 
http://ghc.haskell.org/trac/ghc/changeset/85c1715d086bf2d35bc05133398f462919f2aa7b/ghc

>---------------------------------------------------------------

commit 85c1715d086bf2d35bc05133398f462919f2aa7b
Author: Patrick Palka <[email protected]>
Date:   Fri Aug 30 11:14:40 2013 -0400

    Fix off-by-one error in FastString.getFastStringTable (#8110)
    
    The function was reading past the end of the FastString table, causing
    the -dfaststring-stats option to behave unpredictably.


>---------------------------------------------------------------

85c1715d086bf2d35bc05133398f462919f2aa7b
 compiler/utils/FastString.lhs |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler/utils/FastString.lhs b/compiler/utils/FastString.lhs
index 25f9802..2800d8a 100644
--- a/compiler/utils/FastString.lhs
+++ b/compiler/utils/FastString.lhs
@@ -530,7 +530,7 @@ nilFS = mkFastString ""
 getFastStringTable :: IO [[FastString]]
 getFastStringTable = do
   tbl <- readIORef string_table
-  buckets <- mapM (lookupTbl tbl) [0 .. hASH_TBL_SIZE]
+  buckets <- mapM (lookupTbl tbl) [0 .. hASH_TBL_SIZE-1]
   return buckets
 
 -- 
-----------------------------------------------------------------------------


_______________________________________________
ghc-commits mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/ghc-commits

Reply via email to