[pypy-svn] r18077 - pypy/dist/pypy/translator/c/src

arigo at codespeak.net arigo at codespeak.net
Sun Oct 2 12:27:12 CEST 2005


Author: arigo
Date: Sun Oct  2 12:27:07 2005
New Revision: 18077

Modified:
   pypy/dist/pypy/translator/c/src/main.h
Log:
Bug in the start-up error reporting logic.


Modified: pypy/dist/pypy/translator/c/src/main.h
==============================================================================
--- pypy/dist/pypy/translator/c/src/main.h	(original)
+++ pypy/dist/pypy/translator/c/src/main.h	Sun Oct  2 12:27:07 2005
@@ -6,17 +6,17 @@
 
 int main(int argc, char *argv[])
 {
-    char *errmsg = "out of memory";
+    char *errmsg;
     int i, exitcode;
     RPyListOfString *list;
     errmsg = RPython_StartupCode();
     if (errmsg) goto error;
 
     list = _RPyListOfString_New(argc);
-    if (RPyExceptionOccurred()) goto error;
+    if (RPyExceptionOccurred()) goto memory_out;
     for (i=0; i<argc; i++) {
         RPyString *s = RPyString_FromString(argv[i]);
-        if (RPyExceptionOccurred()) goto error;
+        if (RPyExceptionOccurred()) goto memory_out;
         _RPyListOfString_SetItem(list, i, s);
     }
 
@@ -29,6 +29,8 @@
     }
     return exitcode;
 
+ memory_out:
+    errmsg = "out of memory";
  error:
     fprintf(stderr, "Fatal error during initialization: %s\n", errmsg);
     return 1;



More information about the Pypy-commit mailing list