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

[svn:parrot] r33562 - trunk/compilers/pirc/new

From:
kjs
Date:
December 6, 2008 07:27
Subject:
[svn:parrot] r33562 - trunk/compilers/pirc/new
Message ID:
20081206152746.06DB4CB9AF@x12.develooper.com
Author: kjs
Date: Sat Dec  6 07:27:45 2008
New Revision: 33562

Modified:
   trunk/compilers/pirc/new/bcgen.c

Log:
[pirc] fix some bugs I introduced previous commit (reordering of statements)

Modified: trunk/compilers/pirc/new/bcgen.c
==============================================================================
--- trunk/compilers/pirc/new/bcgen.c	(original)
+++ trunk/compilers/pirc/new/bcgen.c	Sat Dec  6 07:27:45 2008
@@ -315,17 +315,16 @@
 */
 void
 add_sub_pmc(bytecode * const bc,
-            char const * const subname, /* .sub foo --> "foo" */
-            char const * const nsentry, /* .sub foo :nsentry('bar') --> "bar" */
-            char const * const subid,   /* .sub foo :subid('baz') --> "baz" */
-            int vtable_index,           /* vtable entry index */
-            unsigned regs_used[],            /* register usage */
+            char const * const subname,
+            char const * const nsentry,
+            char const * const subid,
+            int vtable_index,
+            unsigned regs_used[],
             int startoffset,
             int endoffset)
 {
-    Interp     *interp    = bc->interp;
     PMC        *sub_pmc;
-    Parrot_sub *sub       = PMC_sub(sub_pmc);
+    Parrot_sub *sub;
     int         subconst_index;
     int         subname_index;
     int         i;
@@ -338,8 +337,9 @@
      * If that should be changed into something else, fix that here (e.g. "Coroutine").
      */
     sub_pmc       = pmc_new(bc->interp, enum_class_Sub);
+    sub           = PMC_sub(sub_pmc);
     subname_index = add_string_const(bc, subname);
-    subname_const = interp->code->const_table->constants[subname_index];
+    subname_const = bc->interp->code->const_table->constants[subname_index];
 
     /* set start and end offset of this sub in the bytecode. This is calculated during
      * the parsing phase.
@@ -351,7 +351,7 @@
     sub->namespace_name   = NULL;
 
     /* XXX does this work properly? is "current_HLL" really "current"? */
-    sub->HLL_id           = CONTEXT(interp)->current_HLL;
+    sub->HLL_id           = CONTEXT(bc->interp)->current_HLL;
 
     /* XXX fix lex stuff */
     sub->lex_info         = NULL;



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