[svn:parrot] r41918 - in branches/pcc_reapply/src: call pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Oct 18 01:58:19 UTC 2009


Author: bacek
Date: Sun Oct 18 01:58:19 2009
New Revision: 41918
URL: https://trac.parrot.org/parrot/changeset/41918

Log:
Fix previous commit. There is possible situations when no signature strings created.

Modified:
   branches/pcc_reapply/src/call/args.c
   branches/pcc_reapply/src/pmc/continuation.pmc

Modified: branches/pcc_reapply/src/call/args.c
==============================================================================
--- branches/pcc_reapply/src/call/args.c	Sun Oct 18 01:42:59 2009	(r41917)
+++ branches/pcc_reapply/src/call/args.c	Sun Oct 18 01:58:19 2009	(r41918)
@@ -2315,10 +2315,11 @@
 Parrot_pcc_parse_signature_string(PARROT_INTERP, ARGIN(STRING *signature),
         ARGMOD(PMC **arg_flags), ARGMOD(PMC **return_flags))
 {
-    const char *s = Parrot_string_cstring(interp, signature);
+    char *s        = Parrot_str_to_cstring(interp, signature);
     *arg_flags    = PMCNULL;
     *return_flags = PMCNULL;
     parse_signature_string(interp, s, arg_flags, return_flags);
+    Parrot_str_free_cstring(s);
 }
 
 /*

Modified: branches/pcc_reapply/src/pmc/continuation.pmc
==============================================================================
--- branches/pcc_reapply/src/pmc/continuation.pmc	Sun Oct 18 01:42:59 2009	(r41917)
+++ branches/pcc_reapply/src/pmc/continuation.pmc	Sun Oct 18 01:58:19 2009	(r41918)
@@ -243,15 +243,18 @@
 
         if (!PMC_IS_NULL(from_obj)) {
             STRING *string_sig = VTABLE_get_string(INTERP, from_obj);
-            PMC *raw_sig, *invalid_sig;
-            Parrot_pcc_parse_signature_string(INTERP, string_sig, &raw_sig, &invalid_sig);
+            /* If there is no string - there is no args */
+            if (string_sig) {
+                PMC *raw_sig, *invalid_sig;
+                Parrot_pcc_parse_signature_string(INTERP, string_sig, &raw_sig, &invalid_sig);
+
+                /* Build results signature for continuation */
+                if (*pc == PARROT_OP_get_results_pc)
+                    call_obj = Parrot_pcc_build_sig_object_returns_from_op(INTERP, call_obj,
+                        Parrot_pcc_get_pmc_constant(INTERP, to_ctx, pc[1]), pc);
 
-            /* Build results signature for continuation */
-            if (*pc == PARROT_OP_get_results_pc)
-                call_obj = Parrot_pcc_build_sig_object_returns_from_op(INTERP, call_obj,
-                    Parrot_pcc_get_pmc_constant(INTERP, to_ctx, pc[1]), pc);
-
-            Parrot_pcc_fill_returns_from_continuation(interp, call_obj, raw_sig, from_obj);
+                Parrot_pcc_fill_returns_from_continuation(interp, call_obj, raw_sig, from_obj);
+            }
         }
 
         /* switch segment */


More information about the parrot-commits mailing list