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

[svn:parrot] r35377 - branches/pcc_invoke_convert/src

From:
Whiteknight
Date:
January 10, 2009 19:50
Subject:
[svn:parrot] r35377 - branches/pcc_invoke_convert/src
Message ID:
20090111035022.67B5FCB9F9@x12.develooper.com
Author: Whiteknight
Date: Sat Jan 10 19:50:20 2009
New Revision: 35377

Modified:
   branches/pcc_invoke_convert/src/multidispatch.c

Log:
[pcc_invoke_convert] fix my last fix by new screwing up the type_tuple

Modified: branches/pcc_invoke_convert/src/multidispatch.c
==============================================================================
--- branches/pcc_invoke_convert/src/multidispatch.c	(original)
+++ branches/pcc_invoke_convert/src/multidispatch.c	Sat Jan 10 19:50:20 2009
@@ -839,7 +839,7 @@
     const INTVAL sig_len    = string_length(interp, string_sig);
     INTVAL       tuple_size = 0;
     INTVAL       args_ended = 0;
-    INTVAL       i;
+    INTVAL       i, j;
 
     /* First calculate the number of arguments participating in MMD */
     for (i = 0; i < sig_len; ++i) {
@@ -852,6 +852,7 @@
 
     VTABLE_set_integer_native(interp, type_tuple, tuple_size);
 
+    j = 0;
     for (i = 0; i < sig_len; ++i) {
         INTVAL type = string_index(interp, string_sig, i);
         if (args_ended)
@@ -861,15 +862,15 @@
         switch (type) {
             case 'I':
                 VTABLE_set_integer_keyed_int(interp, type_tuple,
-                        i, enum_type_INTVAL);
+                        j, enum_type_INTVAL);
                 break;
             case 'N':
                 VTABLE_set_integer_keyed_int(interp, type_tuple,
-                        i, enum_type_FLOATVAL);
+                        j, enum_type_FLOATVAL);
                 break;
             case 'S':
                 VTABLE_set_integer_keyed_int(interp, type_tuple,
-                        i, enum_type_STRING);
+                        j, enum_type_STRING);
                 break;
             case 'P':
             {
@@ -882,12 +883,12 @@
                     i++;
                 }
                 else {
-                    PMC *pmc_arg = VTABLE_get_pmc_keyed_int(interp, sig_obj, i);
+                    PMC *pmc_arg = VTABLE_get_pmc_keyed_int(interp, sig_obj, j);
                     if (PMC_IS_NULL(pmc_arg))
                         VTABLE_set_integer_keyed_int(interp, type_tuple,
-                                i, enum_type_PMC);
+                                j, enum_type_PMC);
                     else
-                        VTABLE_set_integer_keyed_int(interp, type_tuple, i,
+                        VTABLE_set_integer_keyed_int(interp, type_tuple, j,
                                 VTABLE_type(interp, pmc_arg));
                 }
 
@@ -901,6 +902,7 @@
                     EXCEPTION_INVALID_OPERATION,
                     "Multiple Dispatch: invalid argument type %c!", type);
         }
+        j++;
     }
 
     return type_tuple;



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