[svn:parrot] r41819 - branches/pcc_reapply/src/call

tene at svn.parrot.org tene at svn.parrot.org
Sun Oct 11 05:17:13 UTC 2009


Author: tene
Date: Sun Oct 11 05:17:12 2009
New Revision: 41819
URL: https://trac.parrot.org/parrot/changeset/41819

Log:
[pcc] Fail when building a sig for a duplicate named parameter and don't crash.

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

Modified: branches/pcc_reapply/src/call/args.c
==============================================================================
--- branches/pcc_reapply/src/call/args.c	Sun Oct 11 05:05:10 2009	(r41818)
+++ branches/pcc_reapply/src/call/args.c	Sun Oct 11 05:17:12 2009	(r41819)
@@ -492,6 +492,11 @@
                 if (arg_flags & PARROT_ARG_NAME) {
                     string_sig = Parrot_str_append(interp, string_sig, CONST_STRING(interp, "n"));
                     arg_index++;
+                    if (!PMC_IS_NULL(call_object) && VTABLE_exists_keyed_str(interp, call_object, string_value)) {
+                        Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
+                                "duplicate named argument in call");
+
+                    }
                     extract_named_arg_from_op(interp, call_object, string_value,
                             raw_sig, raw_args, arg_index);
                 }


More information about the parrot-commits mailing list