From: Nikodemus S. <de...@us...> - 2014-05-31 17:53:53
|
The branch "master" has been updated in SBCL: via 7166b6985991e6246b42c9757dca1c137f277071 (commit) from 30c17523727cf55ca3b163db5a4c200c1e8451ee (commit) - Log ----------------------------------------------------------------- commit 7166b6985991e6246b42c9757dca1c137f277071 Author: Nikodemus Siivola <nik...@ra...> Date: Sat May 31 19:57:17 2014 +0300 allow using optional arguments in DEFERR handlers Unused for now, use coming in next. --- src/code/interr.lisp | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/code/interr.lisp b/src/code/interr.lisp index 81a9e41..f2dd34c 100644 --- a/src/code/interr.lisp +++ b/src/code/interr.lisp @@ -197,6 +197,17 @@ nil)))) +;;; Returns true if number of arguments matches required/optional +;;; arguments handler expects. +(defun internal-error-args-ok (arguments handler) + (multiple-value-bind (req opt) + (parse-lambda-list (%simple-fun-arglist handler) :silent t) + ;; The handler always gets name as the first (extra) argument. + (let ((n (1+ (length arguments))) + (n-req (length req)) + (n-opt (length opt))) + (and (>= n n-req) (<= n (+ n-req n-opt)))))) + ;;;; INTERNAL-ERROR signal handler (defun internal-error (context continuable) @@ -242,8 +253,7 @@ (handler (and (< -1 error-number (length *internal-errors*)) (svref *internal-errors* error-number)))) (cond ((and (functionp handler) - (eql (1- (length (%simple-fun-arglist handler))) - (length arguments))) + (internal-error-args-ok arguments handler)) (macrolet ((arg (n) `(sb!di::sub-access-debug-var-slot fp (nth ,n arguments) alien-context))) ----------------------------------------------------------------------- hooks/post-receive -- SBCL |