projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix an array indexing bug in getClosureData (used by :print)
[ghc-hetmet.git]
/
compiler
/
ghci
/
RtClosureInspect.hs
diff --git
a/compiler/ghci/RtClosureInspect.hs
b/compiler/ghci/RtClosureInspect.hs
index
e30d1b8
..
0acc830
100644
(file)
--- a/
compiler/ghci/RtClosureInspect.hs
+++ b/
compiler/ghci/RtClosureInspect.hs
@@
-161,9
+161,10
@@
getClosureData a =
itbl <- peek (Ptr iptr)
let tipe = readCType (BCI.tipe itbl)
elems = BCI.ptrs itbl
itbl <- peek (Ptr iptr)
let tipe = readCType (BCI.tipe itbl)
elems = BCI.ptrs itbl
- ptrsList = Array 0 (fromIntegral$ elems) ptrs
+ ptrsList = Array 0 ((fromIntegral elems) - 1) ptrs
nptrs_data = [W# (indexWordArray# nptrs i)
| I# i <- [0.. fromIntegral (BCI.nptrs itbl)] ]
nptrs_data = [W# (indexWordArray# nptrs i)
| I# i <- [0.. fromIntegral (BCI.nptrs itbl)] ]
+ ASSERT(fromIntegral elems >= 0) return ()
ptrsList `seq`
return (Closure tipe (Ptr iptr) itbl ptrsList nptrs_data)
ptrsList `seq`
return (Closure tipe (Ptr iptr) itbl ptrsList nptrs_data)