[svn:parrot] r37872 - trunk/compilers/imcc

jonathan at svn.parrot.org jonathan at svn.parrot.org
Thu Apr 2 19:48:01 UTC 2009


Author: jonathan
Date: Thu Apr  2 19:48:00 2009
New Revision: 37872
URL: https://trac.parrot.org/parrot/changeset/37872

Log:
[core] Patch to resolve TT#500, where during use of the PIR compiler from compreg we would segfault if there was a :init block serving as the :outer of another block.

Modified:
   trunk/compilers/imcc/parser_util.c

Modified: trunk/compilers/imcc/parser_util.c
==============================================================================
--- trunk/compilers/imcc/parser_util.c	Thu Apr  2 19:08:06 2009	(r37871)
+++ trunk/compilers/imcc/parser_util.c	Thu Apr  2 19:48:00 2009	(r37872)
@@ -858,8 +858,18 @@
 {
     ASSERT_ARGS(imcc_compile_pir_ex)
     STRING *error_message;
+    PMC *sub;
+    
+    /* We need to clear the current_results from the current context. This is
+     * in order to prevent any RetContinuations that get promoted to full
+     * Continuations (this happens when something is the target of a :outer)
+     * trying to return values using them when invoked. (See TT#500 for the
+     * report of the bug this fixes). */
+    PMC *save_results = CONTEXT(interp)->current_results;
+    CONTEXT(interp)->current_results = NULL;
+    sub = imcc_compile(interp, s, 0, &error_message);
+    CONTEXT(interp)->current_results = save_results;
 
-    PMC * const sub = imcc_compile(interp, s, 0, &error_message);
     if (sub)
         return sub;
 


More information about the parrot-commits mailing list