projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d8eace
)
Fix an array indexing bug in getClosureData (used by :print)
author
Pepe Iborra
<mnislaih@gmail.com>
Thu, 12 Jul 2007 16:30:12 +0000
(16:30 +0000)
committer
Pepe Iborra
<mnislaih@gmail.com>
Thu, 12 Jul 2007 16:30:12 +0000
(16:30 +0000)
compiler/ghci/RtClosureInspect.hs
patch
|
blob
|
history
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
- 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)] ]
+ ASSERT(fromIntegral elems >= 0) return ()
ptrsList `seq`
return (Closure tipe (Ptr iptr) itbl ptrsList nptrs_data)