From a2bbefda37e2181e078b9636bca456f3b22872ff Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 25 Sep 2002 16:00:50 +0000 Subject: [PATCH] [project @ 2002-09-25 16:00:50 by simonmar] When a command-line evaluation returns an exception, revert to the old interactive context, because the new context will bind 'it' to a name that doesn't exist in the linker's symbol table. --- ghc/compiler/compMan/CompManager.lhs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/compMan/CompManager.lhs b/ghc/compiler/compMan/CompManager.lhs index 64b332e..3b3a2aa 100644 --- a/ghc/compiler/compMan/CompManager.lhs +++ b/ghc/compiler/compMan/CompManager.lhs @@ -319,8 +319,11 @@ cmRunStmt cmstate@CmState{ hpt=hpt, pcs=pcs, ic=icontext } case either_hvals of Left e -> do - return ( cmstate{ pcs=new_pcs, ic=new_ic }, - CmRunException e ) + -- on error, keep the *old* interactive context, + -- so that 'it' is not bound to something + -- that doesn't exist. + return ( cmstate{ pcs=new_pcs }, CmRunException e ) + Right hvals -> do -- Get the newly bound things, and bind them. -- Don't need to delete any shadowed bindings; -- 1.7.10.4