[svn:parrot] r42082 - trunk/src/pmc

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat Oct 24 18:33:34 UTC 2009


Author: chromatic
Date: Sat Oct 24 18:33:32 2009
New Revision: 42082
URL: https://trac.parrot.org/parrot/changeset/42082

Log:
[PMC] Fixed RetContinuation recycling in invoke() by invalidating the from
context's pointer to the RetCont PMC.  This fixes an assert in an unoptimized
build in PGE, created by r42058.  This also requires that the RetCont's
from_ctx pointer can't point to the same place as its to_ctx, or else the wrong
context gets nulled out.

Something may not set the from_ctx pointer correctly before invoking the
RetCont.

Modified:
   trunk/src/pmc/retcontinuation.pmc

Modified: trunk/src/pmc/retcontinuation.pmc
==============================================================================
--- trunk/src/pmc/retcontinuation.pmc	Sat Oct 24 15:28:21 2009	(r42081)
+++ trunk/src/pmc/retcontinuation.pmc	Sat Oct 24 18:33:32 2009	(r42082)
@@ -39,7 +39,7 @@
         Parrot_RetContinuation_attributes * const attrs = PARROT_RETCONTINUATION(SELF);
 
         attrs->to_ctx          = CURRENT_CONTEXT(interp);
-        attrs->from_ctx        = CURRENT_CONTEXT(interp);    /* filled in during a call */
+        attrs->from_ctx        = PMCNULL;    /* filled in during a call */
         attrs->runloop_id      = 0;
         attrs->seg             = interp->code;
         attrs->address         = NULL;
@@ -82,6 +82,9 @@
         Parrot_continuation_check(interp, SELF);
         Parrot_continuation_rewind_environment(interp, SELF);
 
+        /* recycle this PMC and make sure it doesn't get marked */
+        if (!PMC_IS_NULL(from_ctx))
+            Parrot_pcc_set_continuation(interp, from_ctx, NULL);
         Parrot_gc_free_pmc_header(interp, SELF);
 
         if (INTERP->code != seg)


More information about the parrot-commits mailing list