Author: leo
Date: Sat Aug 20 06:50:01 2005
New Revision: 9006

Modified:
   branches/leo-ctx5/classes/retcontinuation.pmc
Log:
small cleanup; doc fix

Modified: branches/leo-ctx5/classes/retcontinuation.pmc
==============================================================================
--- branches/leo-ctx5/classes/retcontinuation.pmc       (original)
+++ branches/leo-ctx5/classes/retcontinuation.pmc       Sat Aug 20 06:50:01 2005
@@ -10,8 +10,8 @@ classes/retcontinuation.pmc - Return Con
 
 C<RetContinuation> extends C<Continuation>.
 
-A return continuation is like a Continuation, only its context isn't marked,
-because that's just some previous state of the interpreter.
+A return continuation is a one shot Continuation, it gets recycled
+immediately after invocation.
 
 =head2 Methods
 
@@ -81,7 +81,7 @@ the frame pointer in the stack frame cac
          * unwind control stack
          */
         stack_now = CONTEXT(INTERP->ctx)->control_stack;
-        ctr_stack = CONTEXT(PMC_cont(SELF)->to_ctx)->control_stack;
+        ctr_stack = CONTEXT(cc->to_ctx)->control_stack;
         while (stack_now != ctr_stack) {
             if (!stack_now || !ctr_stack)
                 internal_exception(1, "Control stack damaged");
@@ -102,9 +102,6 @@ the frame pointer in the stack frame cac
                     Parrot_full_sub_name(INTERP, sub));
         }
         caller_regs = INTERP->ctx.bp;
-        /* if free_context destroys, we have to remember the ptr */
-        Parrot_free_context(INTERP, &cc->from_ctx, 1);
-        cc->from_ctx.bp = NULL;
         INTERP->ctx = cc->to_ctx;
         next = cc->address;
         if (next) {
@@ -124,6 +121,8 @@ the frame pointer in the stack frame cac
             }
             INTERP->current_returns = NULL;
         }
+        Parrot_free_context(INTERP, &cc->from_ctx, 1);
+        cc->from_ctx.bp = NULL;
         INTERP->current_args = NULL;
         /* no address and no segment */
         if (!cc->seg) {

Reply via email to