[svn:parrot] r44721 - branches/pcc_hackathon_6Mar10/src/call

allison at svn.parrot.org allison at svn.parrot.org
Sun Mar 7 00:38:27 UTC 2010


Author: allison
Date: Sun Mar  7 00:38:25 2010
New Revision: 44721
URL: https://trac.parrot.org/parrot/changeset/44721

Log:
[pcc] Convert the method dispatch function to fetch returns after invocation.
This causes an infinite loop of "too few positional arguments" while generating
PGE.pbc. Committing so others can work on the bug, but if this gets in anyone's
way, revert it.

Modified:
   branches/pcc_hackathon_6Mar10/src/call/pcc.c

Modified: branches/pcc_hackathon_6Mar10/src/call/pcc.c
==============================================================================
--- branches/pcc_hackathon_6Mar10/src/call/pcc.c	Sun Mar  7 00:25:07 2010	(r44720)
+++ branches/pcc_hackathon_6Mar10/src/call/pcc.c	Sun Mar  7 00:38:25 2010	(r44721)
@@ -186,14 +186,15 @@
         ARGIN(const char *signature), ...)
 {
     ASSERT_ARGS(Parrot_pcc_invoke_method_from_c_args)
-    PMC    *sig_obj;
+    PMC    *call_obj;
     PMC    *sub_obj;
     va_list args;
+    char *arg_sig, *ret_sig;
+    Parrot_pcc_split_signature_string(interp, signature, &arg_sig, &ret_sig);
 
     va_start(args, signature);
-    sig_obj = Parrot_pcc_build_sig_object_from_varargs(interp, pmc,
-                 signature, args);
-    va_end(args);
+    call_obj = Parrot_pcc_build_call_from_varargs(interp, pmc,
+                 arg_sig, &args);
 
     /* Find the subroutine object as a named method on pmc */
     sub_obj = VTABLE_find_method(interp, pmc, method_name);
@@ -202,9 +203,11 @@
          Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_METHOD_NOT_FOUND,
              "Method '%Ss' not found", method_name);
 
-    /* Invoke the subroutine object with the given CallSignature object */
+    /* Invoke the subroutine object with the given CallContext object */
     interp->current_object = pmc;
-    Parrot_pcc_invoke_from_sig_object(interp, sub_obj, sig_obj);
+    Parrot_pcc_invoke_from_sig_object(interp, sub_obj, call_obj);
+    Parrot_pcc_fill_params_from_varargs(interp, call_obj, ret_sig, &args);
+    va_end(args);
 }
 
 /*


More information about the parrot-commits mailing list