[svn:parrot] r40370 - trunk/src

NotFound at svn.parrot.org NotFound at svn.parrot.org
Sun Aug 2 02:20:54 UTC 2009


Author: NotFound
Date: Sun Aug  2 02:20:54 2009
New Revision: 40370
URL: https://trac.parrot.org/parrot/changeset/40370

Log:
[cage] add some comments and minor fixes to r40363 additions, JimmyZ++

Modified:
   trunk/src/exceptions.c

Modified: trunk/src/exceptions.c
==============================================================================
--- trunk/src/exceptions.c	Sun Aug  2 01:31:53 2009	(r40369)
+++ trunk/src/exceptions.c	Sun Aug  2 02:20:54 2009	(r40370)
@@ -106,6 +106,10 @@
     STRING * const message     = VTABLE_get_string(interp, exception);
     INTVAL         exit_status = 1;
     const INTVAL   severity    = VTABLE_get_integer_keyed_str(interp, exception, CONST_STRING(interp, "severity"));
+
+    /* In some cases we have a fatal exception before the IO system
+     * is completely initialized. Do some attempt to output the
+     * message to stderr, to help diagnosing. */
     int use_perr = !PMC_IS_NULL(Parrot_io_STDERR(interp));
 
     /* flush interpreter output to get things printed in order */
@@ -126,8 +130,10 @@
         if (use_perr)
             Parrot_io_eprintf(interp, "%S\n", message);
         else {
+            fflush(stderr);
             char * const msg = Parrot_str_to_cstring(interp, message);
-            fprintf(stderr, "%s\n", msg);
+            fprintf(stderr, "\n%s\n", msg);
+            Parrot_str_free_cstring(msg);
         }
 
         /* caution against output swap (with PDB_backtrace) */


More information about the parrot-commits mailing list