Author: jonathan
Date: Fri Dec  5 14:24:30 2008
New Revision: 33526

Modified:
   trunk/compilers/imcc/parser_util.c

Log:
[imcc] If we fail during the compile, don't try and run any :init subs we might 
have been lucky enough to have already compiled by that point.

Modified: trunk/compilers/imcc/parser_util.c
==============================================================================
--- trunk/compilers/imcc/parser_util.c  (original)
+++ trunk/compilers/imcc/parser_util.c  Fri Dec  5 14:24:30 2008
@@ -669,6 +669,8 @@
         sub_data->start_offs = 0;
         sub_data->end_offs   = new_cs->base.size;
         sub_data->name       = string_from_cstring(interp, name, 0);
+
+        *error_message = NULL;
     }
     else {
         *error_message = IMCC_INFO(interp)->error_message;
@@ -693,7 +695,8 @@
     yylex_destroy(yyscanner);
 
     /* Now run any :load/:init subs. */
-    PackFile_fixup_subs(interp, PBC_MAIN, sub);
+    if (!*error_message)
+        PackFile_fixup_subs(interp, PBC_MAIN, sub);
 
     /* restore old byte_code, */
     if (old_cs)

Reply via email to