X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fghci%2FByteCodeGen.lhs;h=d5dca0e36d09397052309bcb8da9e6b3ba800bd3;hb=a5687b3b04c2e404a5ed5bf56ba4e7a10f7d115a;hp=b0234f0afc7756b84cb7e50d3c7f067b31c29a1b;hpb=cdc9f210dfb6086db2ccd0b6b9de0a685b17f773;p=ghc-hetmet.git diff --git a/ghc/compiler/ghci/ByteCodeGen.lhs b/ghc/compiler/ghci/ByteCodeGen.lhs index b0234f0..d5dca0e 100644 --- a/ghc/compiler/ghci/ByteCodeGen.lhs +++ b/ghc/compiler/ghci/ByteCodeGen.lhs @@ -380,8 +380,8 @@ schemeE d s p (AnnLet binds (_,body)) fvss = map (fvsToEnv p' . fst) rhss - -- Sizes of free vars, + 1 for the fn - sizes = map (\rhs_fvs -> 1 + sum (map idSizeW rhs_fvs)) fvss + -- Sizes of free vars + sizes = map (\rhs_fvs -> sum (map idSizeW rhs_fvs)) fvss -- the arity of each rhs arities = map (length . fst . collect []) rhss @@ -397,7 +397,7 @@ schemeE d s p (AnnLet binds (_,body)) -- ToDo: don't build thunks for things with no free variables build_thunk dd [] size bco off = returnBc (PUSH_BCO bco - `consOL` unitOL (MKAP (off+size-1) size)) + `consOL` unitOL (MKAP (off+size) size)) build_thunk dd (fv:fvs) size bco off = do (push_code, pushed_szw) <- pushAtom dd p' (AnnVar fv) more_push_code <- build_thunk (dd+pushed_szw) fvs size bco off