diff options
author | Ian Lynagh <igloo@earth.li> | 2007-09-07 23:33:30 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2007-09-07 23:33:30 +0000 |
commit | 907c44ca14e479e5fa64d712703b8fbad19d1e04 (patch) | |
tree | 9ceaaeeed68182b38108e7dec7801ffa80ebde4b | |
parent | cd14f4675f2ba7a2354a8b1bad3e68dd4ba61642 (diff) | |
download | haskell-907c44ca14e479e5fa64d712703b8fbad19d1e04.tar.gz |
Fix assertions in RtClosureInspect
-rw-r--r-- | compiler/ghci/RtClosureInspect.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index 4025aa2d6f..a05830eb65 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -179,7 +179,7 @@ getClosureData a = ptrsList = Array 0 (elems - 1) elems ptrs nptrs_data = [W# (indexWordArray# nptrs i) | I# i <- [0.. fromIntegral (BCI.nptrs itbl)] ] - ASSERT(fromIntegral elems >= 0) return () + ASSERT(elems >= 0) return () ptrsList `seq` return (Closure tipe (Ptr iptr) itbl ptrsList nptrs_data) @@ -766,7 +766,7 @@ unlessM condM acc = condM >>= \c -> unless c acc -- Strict application of f at index i appArr :: Ix i => (e -> a) -> Array i e -> Int -> a -appArr f (Array _ _ _ ptrs#) (I# i#) +appArr f a@(Array _ _ _ ptrs#) i@(I# i#) = ASSERT (i < length(elems a)) case indexArray# ptrs# i# of (# e #) -> f e |