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

jonathan at svn.parrot.org jonathan at svn.parrot.org
Sun May 30 00:59:52 UTC 2010


Author: jonathan
Date: Sun May 30 00:59:52 2010
New Revision: 47121
URL: https://trac.parrot.org/parrot/changeset/47121

Log:
[core] Rather than just getting the thrower context, we should actually then use it to try and obtain a backtrace, not just toss it in favor of (probably the handler's) context.

Modified:
   trunk/src/pmc/exception.pmc

Modified: trunk/src/pmc/exception.pmc
==============================================================================
--- trunk/src/pmc/exception.pmc	Sun May 30 00:39:48 2010	(r47120)
+++ trunk/src/pmc/exception.pmc	Sun May 30 00:59:52 2010	(r47121)
@@ -795,10 +795,13 @@
             Parrot_pcc_invoke_method_from_c_args(INTERP, cont->to_ctx, CONST_STRING(INTERP, "backtrace"), "P->P", resume, &result);
         }
         else {
+            /* Hopefully we have a thrower set - our most epic fail fallback is
+             * to just assume the thrower is the current context. */
             PMC *cur_ctx;
-            /* No return continuation. Assuming we're being called  */
             GET_ATTR_thrower(INTERP, SELF, cur_ctx);
-            Parrot_pcc_invoke_method_from_c_args(INTERP, CURRENT_CONTEXT(INTERP), CONST_STRING(INTERP, "backtrace"), "->P", &result);
+            if (PMC_IS_NULL(cur_ctx))
+                cur_ctx = CURRENT_CONTEXT(INTERP);
+            Parrot_pcc_invoke_method_from_c_args(INTERP, cur_ctx, CONST_STRING(INTERP, "backtrace"), "->P", &result);
         }
 
         RETURN(PMC *result);


More information about the parrot-commits mailing list