From: simonmar Date: Mon, 19 May 2003 11:37:07 +0000 (+0000) Subject: [project @ 2003-05-19 11:37:07 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~901 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=69164b870a57e9f7bd6f4eb3d257c8c3e80fcb0f;p=ghc-hetmet.git [project @ 2003-05-19 11:37:07 by simonmar] Fix a pair of off-by-one errors that meant that BCOs were normally two words larger than they needed to be. --- diff --git a/ghc/compiler/ghci/ByteCodeAsm.lhs b/ghc/compiler/ghci/ByteCodeAsm.lhs index d1a737a..f067840 100644 --- a/ghc/compiler/ghci/ByteCodeAsm.lhs +++ b/ghc/compiler/ghci/ByteCodeAsm.lhs @@ -172,11 +172,11 @@ assembleBCO (ProtoBCO nm instrs bitmap bsize arity origin malloced) mkBitmapArray :: Int -> [StgWord] -> UArray Int StgWord mkBitmapArray bsize bitmap - = listArray (0, 1 + length bitmap) (fromIntegral bsize : bitmap) + = listArray (0, length bitmap) (fromIntegral bsize : bitmap) mkInstrArray :: Int -> [Word16] -> UArray Int Word16 mkInstrArray n_insns asm_insns - = listArray (0, 1 + n_insns) (fromIntegral n_insns : asm_insns) + = listArray (0, n_insns) (fromIntegral n_insns : asm_insns) -- instrs nonptrs ptrs itbls type AsmState = (SizedSeq Word16,