Changeset 14950


Ignore:
Timestamp:
01/16/17 17:38:53 (5 years ago)
Author:
Mark Evenson
Message:

Fix restart calculation for compiled closures (Alan Ruttenberg)

Fix getFunctionClassBytes for CompiledClosures.

Closes <https://github.com/armedbear/abcl/issues/3> and <http://abcl.org/trac/ticket/414>.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/restart.lisp

    r11785 r14950  
    6363
    6464(defun compute-restarts (&optional condition)
     65  (let ((res ()))
     66    (map-restarts (lambda(restart) (push restart res)) condition t)
     67    (nreverse res)))
     68
     69(defun map-restarts (fn condition call-test-p)
    6570  (let ((associated ())
    6671  (other ()))
     
    6974    (setq associated (cdr alist))
    7075    (setq other (append (cdr alist) other))))
    71     (let ((res ()))
    72       (dolist (restart-cluster *restart-clusters*)
    73         (dolist (restart restart-cluster)
    74           (when (and (or (not condition)
    75                          (member restart associated)
    76                          (not (member restart other)))
    77                      (funcall (restart-test-function restart) condition))
    78             (push restart res))))
    79       (nreverse res))))
     76    (dolist (restart-cluster *restart-clusters*)
     77      (dolist (restart restart-cluster)
     78  (when (and (or (not condition)
     79           (member restart associated)
     80           (not (member restart other)))
     81       (or (not call-test-p)
     82           (funcall (restart-test-function restart) condition)))
     83    (funcall fn restart))))))
     84
    8085
    8186(defun restart-report (restart stream)
     
    106111
    107112(defun invoke-restart (restart &rest values)
    108   (let ((real-restart (find-restart-or-control-error restart)))
     113  (let ((real-restart
     114    (if (restart-p restart)
     115        (catch 'found
     116    (map-restarts (lambda(r) (when (eq r restart)
     117             (throw 'found r)))
     118            nil nil)
     119    (error 'control-error
     120           :format-control "Restart ~S is not active."
     121           :format-arguments (list restart)))
     122        (find-restart-or-control-error restart))))
    109123    (apply (restart-function real-restart) values)))
    110124
     
    116130
    117131(defun invoke-restart-interactively (restart)
    118   (let* ((real-restart (find-restart-or-control-error restart))
    119          (args (interactive-restart-arguments real-restart)))
     132  (let* ((real-restart
     133     (if (restart-p restart)
     134         (catch 'found
     135     (map-restarts (lambda(r) (when (eq r restart)
     136              (throw 'found r)))
     137             nil nil)
     138     (error 'control-error
     139      :format-control "Restart ~S is not active."
     140      :format-arguments (list restart)))
     141         (find-restart-or-control-error restart)))
     142   (args (interactive-restart-arguments real-restart))
     143   )
    120144    (apply (restart-function real-restart) args)))
    121 
    122145
    123146(defun parse-keyword-pairs (list keys)
Note: See TracChangeset for help on using the changeset viewer.