Changeset 9846


Ignore:
Timestamp:
Jun 29, 2008, 1:49:01 AM (11 years ago)
Author:
gz
Message:

Make untrace more tolerant of bindings having changed behind its back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/encapsulate.lisp

    r9844 r9846  
    118118  (get-encapsulation fn-or-method))
    119119
     120(defun %encap-fboundp (thing)
     121  (etypecase thing
     122    (symbol (fboundp thing))
     123    (method (%method-function thing))))
     124 
    120125(defun %encap-binding (thing)
    121126  (require-type (etypecase thing
     
    165170(defun remove-encapsulation (cap)
    166171  (let* ((owner (encapsulation-owner cap))
    167          (cur-def (%encap-binding owner))
     172         (cur-def (%encap-fboundp owner))
    168173         (old-def (encapsulation-old-def cap)))
    169     (assert (eq cap (get-encapsulation cur-def)))
    170     (set-encapsulation-owner old-def owner)
    171174    (typecase owner
    172175      (symbol
    173        (cond ((standard-generic-function-p cur-def)
     176       (cond ((or (null cur-def)
     177                  (not (eq cap (get-encapsulation cur-def))))
     178              ;; rebound behind our back, oh well.
     179              nil)
     180             ((standard-generic-function-p cur-def)
    174181              (remhash (%gf-dcode cur-def) *encapsulation-table*)
     182              (set-encapsulation-owner old-def owner)
    175183              (setf (%gf-dcode cur-def) (%gf-dcode old-def)))
    176184             (t
    177185              (remhash cur-def *encapsulation-table*)
     186              (set-encapsulation-owner old-def owner)
    178187              (%fhave owner old-def))))
    179188      (method
    180189       (remhash cur-def *encapsulation-table*)
     190       (set-encapsulation-owner old-def owner)
    181191       (setf (%method-function owner) old-def)
    182192       (remove-obsoleted-combined-methods owner)))))
Note: See TracChangeset for help on using the changeset viewer.