develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r36041 - trunk/src

From:
julianalbo
Date:
January 26, 2009 15:58
Subject:
[svn:parrot] r36041 - trunk/src
Message ID:
20090126235822.64B57CB9AE@x12.develooper.com
Author: julianalbo
Date: Mon Jan 26 15:58:21 2009
New Revision: 36041

Modified:
   trunk/src/exceptions.c

Log:
fix some problems in Parrot_print_backtrace

Modified: trunk/src/exceptions.c
==============================================================================
--- trunk/src/exceptions.c	(original)
+++ trunk/src/exceptions.c	Mon Jan 26 15:58:21 2009
@@ -598,10 +598,14 @@
 #  else
     { /* Scope for strings */
         char ** strings = backtrace_symbols(array, size);
-        for (i = 0; i < size; i++)
-            fprintf(stderr, "%s\n", strings[i]);
-
-        mem_sys_free(strings);
+        if (strings) {
+            for (i = 0; i < size; i++)
+                fprintf(stderr, "%s\n", strings[i]);
+            /* backtrace_symbols gets memory using malloc */
+            free(strings);
+        }
+        else
+            fputs("Not enough memory for backtrace_symbols\n", stderr);
     }
 #  endif
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About