Author: kjs
Date: Tue Dec 30 02:12:49 2008
New Revision: 34630
Modified:
trunk/compilers/pirc/new/pircompunit.c
Log:
[pirc] count :named arguments twice as well; once for the argument itself, once
for the :named() flag value.
Modified: trunk/compilers/pirc/new/pircompunit.c
==============================================================================
--- trunk/compilers/pirc/new/pircompunit.c (original)
+++ trunk/compilers/pirc/new/pircompunit.c Tue Dec 30 02:12:49 2008
@@ -1559,18 +1559,25 @@
*/
invocation *
set_invocation_args(invocation * const inv, argument * const args) {
- argument *count_iter;
+ argument *arg_iter;
unsigned arg_count = 0;
inv->arguments = args;
if (args) {
- count_iter = args->next;
+ arg_iter = args->next;
do {
- count_iter = count_iter->next;
- ++arg_count;
+ arg_iter = arg_iter->next;
+
+ /* count :named arguments twice, once for the argument,
+ * once for the :named flag value.
+ */
+ if (TEST_FLAG(arg_iter->flags, TARGET_FLAG_NAMED))
+ arg_count += 2;
+ else
+ ++arg_count;
}
- while (count_iter != args->next);
+ while (arg_iter != args->next);
}
/* fprintf(stderr, "invocation has %u args\n", arg_count); */