X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fghci%2FRtClosureInspect.hs;h=4f9588f6db99df5b962ea04490b7fb3fe26a11a9;hp=10dbb163532cb2d4ce11b2b787c56cba4966208b;hb=30ad291abbe718ff9f96469d8c86be0eee55d50c;hpb=0daf69ba7856dc3dca65b7bccfd59a29ef632a6e diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index 10dbb16..4f9588f 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -179,7 +179,15 @@ getClosureData :: a -> IO Closure getClosureData a = case unpackClosure# a of (# iptr, ptrs, nptrs #) -> do +#ifndef GHCI_TABLES_NEXT_TO_CODE + -- the info pointer we get back from unpackClosure# is to the + -- beginning of the standard info table, but the Storable instance + -- for info tables takes into account the extra entry pointer + -- when !tablesNextToCode, so we must adjust here: + itbl <- peek (Ptr iptr `plusPtr` negate wORD_SIZE) +#else itbl <- peek (Ptr iptr) +#endif let tipe = readCType (BCI.tipe itbl) elems = fromIntegral (BCI.ptrs itbl) ptrsList = Array 0 (elems - 1) elems ptrs