From 8aee46b839ec04b5e441788c33bc885f43e59a29 Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sat, 13 Mar 2010 23:47:27 +0100 Subject: [PATCH] In EXT:SAFE-EVAL avoid the debugger being entered at all. --- src/CHANGELOG | 3 +++ src/lsp/top.lsp | 14 +++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/CHANGELOG b/src/CHANGELOG index 0546a95c8..c882ff556 100755 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -14,6 +14,9 @@ ECL 10.3.2: - The reimplementation of DIRECTORY introduced a bug in pathnames with ending double wildcars, such as "/foo/**/". + - EXT:SAFE-EVAL (or cl_safe_eval in C) would attempt to start the debugger + when an error was signaled. + * Visible changes: - The source location annotator records the original pathnames, not the diff --git a/src/lsp/top.lsp b/src/lsp/top.lsp index bc1c15982..cd422b3cc 100644 --- a/src/lsp/top.lsp +++ b/src/lsp/top.lsp @@ -1480,13 +1480,13 @@ supplied, then SAFE-EVAL will not use a debugger but rather return that value." (let ((output nil) (ok nil)) (unwind-protect - (if err-value-p - (let ((*break-enable* nil)) - (setf output (si::eval-with-env form env) - ok t)) - (handler-bind ((serious-condition #'invoke-debugger)) - (setf output (si::eval-with-env form env) - ok t))) + (handler-bind ((serious-condition + (if err-value-p + #'(lambda (c) + (return-from safe-eval err-value)) + #'invoke-debugger))) + (setf output (si::eval-with-env form env) + ok t)) (return-from safe-eval (if ok output err-value))))) #-ecl-min