Changeset 8940


Ignore:
Timestamp:
Mar 30, 2008, 7:39:44 AM (11 years ago)
Author:
gb
Message:

In ARGUMENTS-AND-LOCALS, account for inherited values (in closures)
and treat them as locals.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lib/backtrace.lisp

    r8923 r8940  
    506506  (multiple-value-bind (vars map-indices) (variables-in-scope lfun pc)
    507507    (collect ((args)
     508              (inherited-indices)
     509              (inherited-vars)
    508510              (locals))
    509511      (multiple-value-bind (valid req opt rest keys)
    510512          (arg-names-from-map lfun pc)
    511513        (when valid
     514          (let* ((numinh (ldb $lfbits-numinh (lfun-bits lfun))))
     515            (dotimes (i numinh)
     516              (inherited-indices (pop map-indices))
     517              (inherited-vars (pop vars))))
    512518          (let* ((nargs (+ (length req) (length opt) (if rest 1 0) (length keys)))
    513519                 (nlocals (- (length vars) nargs))
    514                  (local-vars (nthcdr nargs vars))
    515                  (local-indices (nthcdr nargs map-indices))
     520                 (local-vars (append (nthcdr nargs vars) (inherited-vars)))
     521                 (local-indices (append (nthcdr nargs map-indices) (inherited-indices)))
    516522                 (arg-vars (nbutlast vars nlocals))
    517523                 (arg-indices (nbutlast map-indices nlocals)))
     
    531537              (dolist (name keys)
    532538                (get-arg-value name))
    533               #+no
    534               (setq local-vars (nreverse local-vars)
    535                     local-indices (nreverse local-indices))
    536539              (dolist (name local-vars)
    537540                (get-local-value name)))))
Note: See TracChangeset for help on using the changeset viewer.