Commit 834fcf7d authored by mnislaih's avatar mnislaih
Browse files

Fix an array indexing bug in getClosureData (used by :print)

parent 4d8eace1
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment