[project @ 2003-05-19 11:37:07 by simonmar]
authorsimonmar <unknown>
Mon, 19 May 2003 11:37:07 +0000 (11:37 +0000)
committersimonmar <unknown>
Mon, 19 May 2003 11:37:07 +0000 (11:37 +0000)
Fix a pair of off-by-one errors that meant that BCOs were normally two
words larger than they needed to be.

ghc/compiler/ghci/ByteCodeAsm.lhs

index d1a737a..f067840 100644 (file)
@@ -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,