Changeset 12071


Ignore:
Timestamp:
07/28/09 06:23:20 (14 years ago)
Author:
ehuelsmann
Message:

Retain values across execution of unwinding forms
in unwind protect, in case of errors/non-local returns.

Found by: Alan Ruttenberg.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

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

    r12055 r12071  
    37123712          {
    37133713            result = eval(args.car(), env, thread);
     3714          }
     3715        finally
     3716          {
    37143717            values = thread._values;
    3715           }
    3716         finally
    3717           {
    37183718            LispObject body = args.cdr();
    37193719            while (body != NIL)
     
    37223722                body = ((Cons)body).cdr;
    37233723              }
     3724            thread._values = values;
    37243725          }
    37253726        if (values != null)
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r12051 r12071  
    78297829      ;; The Throwable object is on the runtime stack. Stack depth is 1.
    78307830      (astore exception-register)
     7831      (emit-push-current-thread)
     7832      (emit 'getfield +lisp-thread-class+ "_values" +lisp-object-array+)
     7833      (astore values-register)
    78317834      (let ((*register* *register*))
    78327835        (dolist (subform cleanup-forms)
    78337836          (compile-form subform nil nil)))
    78347837      (maybe-emit-clear-values cleanup-forms)
     7838      (emit-push-current-thread)
     7839      (aload values-register)
     7840      (emit 'putfield +lisp-thread-class+ "_values" +lisp-object-array+)
    78357841      (aload exception-register)
    78367842      (emit 'athrow) ; Re-throw exception.
Note: See TracChangeset for help on using the changeset viewer.