develooper Front page | perl.cvs.parrot | Postings from December 2008

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

From:
jonathan
Date:
December 5, 2008 14:24
Subject:
[svn:parrot] r33526 - trunk/compilers/imcc
Message ID:
20081205222431.263E9CB9AF@x12.develooper.com
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)



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