diff --git a/code/debug.lisp b/code/debug.lisp
index 8ed2dc4870ed0e7c31f76dcfbb95aa38b02ed83c..beb6cfca5527363a44ce06134908ee2dd7fcba4b 100644
--- a/code/debug.lisp
+++ b/code/debug.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/debug.lisp,v 1.61 2003/06/26 13:27:42 toy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/debug.lisp,v 1.62 2003/07/20 11:02:48 gerd Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1151,8 +1151,17 @@ See the CMU Common Lisp User's Manual for more information.
 	(num 0))			; better be the same as show-restarts!
     (dolist (restart restarts)
       (let ((name (string (restart-name restart))))
+	;;
+	;; Use %Invoke-Restart-Interactively because the dynamic
+	;; environment when the debugger invokes the restart can be
+	;; different from the dynamic environment when the debugger
+	;; computes active restarts.  If this is the case,
+	;; Invoke-Restart-Interactively might find that the restart
+	;; being invoked is not currently active and signal a
+	;; Control-Error.
         (let ((restart-fun
-	       #'(lambda () (invoke-restart-interactively restart))))
+	       (lambda ()
+		 (conditions::%invoke-restart-interactively restart))))
 	  (push (cons (format nil "~d" num) restart-fun) commands)
 	  (unless (or (null (restart-name restart)) 
 	              (find name commands :key #'car :test #'string=))
diff --git a/code/error.lisp b/code/error.lisp
index 19c4e501ff8192715b07d8837f1107ea92619f5f..6f6f669e3c1f8c49db97531e139b16c1e01d6aae 100644
--- a/code/error.lisp
+++ b/code/error.lisp
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/error.lisp,v 1.75 2003/05/03 11:22:09 gerd Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/error.lisp,v 1.76 2003/07/20 11:02:48 gerd Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -209,13 +209,19 @@
       (error 'simple-control-error
 	     :format-control "Restart ~S is not active."
 	     :format-arguments (list restart)))
-    (apply (restart-function real-restart)
-	   (let ((interactive-function
-		  (restart-interactive-function real-restart)))
-	     (if interactive-function
-		 (funcall interactive-function)
-		 '())))))
+    (%invoke-restart-interactively real-restart)))
 
+;;;
+;;; Like Invoke-Restart-Interactively, but don't check if the restart
+;;; is currently active.  Used by the debugger.
+;;;
+(defun %invoke-restart-interactively (restart)
+  (apply (restart-function restart)
+	 (let ((interactive-function
+		(restart-interactive-function restart)))
+	   (if interactive-function
+	       (funcall interactive-function)
+	       '()))))
 
 (eval-when (compile load eval)