Ignore:
Timestamp:
05/10/09 21:21:44 (15 years ago)
Author:
ehuelsmann
Message:

Restore closure variables from their saved values,
in case of a non-local transfer of control (ie,
a Java exception), such as GO or RETURN-FROM in
the callee.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r11852 r11853  
    30213021         (local-function (find-local-function op))
    30223022         (*register* *register*)
    3023          (saved-vars '()))
     3023         (saved-vars '())
     3024         (label-START (gensym))
     3025         (label-END (gensym))
     3026         (label-EXIT (gensym)))
    30243027    (cond ((local-function-variable local-function)
    30253028           ;; LABELS
     
    30323035                                    *visible-variables*))))
    30333036;;            (emit 'var-ref (local-function-variable local-function) 'stack)
     3037           (when saved-vars
     3038             (label label-START))
    30343039           (compile-var-ref (make-var-ref (local-function-variable local-function)) 'stack nil))
    30353040          (t
     
    30503055    (emit-move-from-stack target representation)
    30513056    (when saved-vars
    3052       (restore-variables saved-vars)))
     3057      (emit 'goto label-EXIT)
     3058      (label label-END)
     3059      (restore-variables saved-vars)
     3060      (emit 'athrow)
     3061      (label label-EXIT)
     3062      (restore-variables saved-vars)
     3063      (push (make-handler :from label-START
     3064                          :to label-END
     3065                          :code label-END
     3066                          :catch-type 0) *handlers*)))
    30533067  t)
    30543068
Note: See TracChangeset for help on using the changeset viewer.