pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:6136:    push_finished_type(mixed_type_string);    free_type(res);    } else {    /* More arguments to check. */    push_finished_type(res);    free_type(res);    push_type(T_NOT);    }    res = pop_unfinished_type();    } -  } else if (!(flags & CALL_LAST_ARG) && +  } else if ((flags & CALL_NOT_LAST_ARG) &&    (fun_type->car->type == T_MANY)) {    /* The next argument might match. */    add_ref(fun_type);    res = fun_type;    }    }    break;       case PIKE_T_TYPE:    /* FIXME: Check that the cast is valid. */
pike.git/src/pike_types.c:6255:   #endif /* PIKE_DEBUG */    res = NULL;    if (tmp) free_type(tmp);    break;    }    }    /* Match. */    if (fun_type->type == PIKE_T_FUNCTION) {    /* Advance to the next argument. */    fun_type = fun_type->cdr; -  if ((flags & CALL_LAST_ARG) && -  (fun_type->type == PIKE_T_FUNCTION)) { +  if (!(flags & CALL_NOT_LAST_ARG) && +  (fun_type->type == PIKE_T_FUNCTION) && +  !low_match_types(fun_type->car, void_type_string, 0)) {    /* There are more required arguments. */   #ifdef PIKE_DEBUG    if (l_flag>2) {    fprintf(stderr, "%*sMore arguments required.\n", indent*2+2, "");    }   #endif /* PIKE_DEBUG */    res = NULL;    if (tmp) free_type(tmp);    break;    }
pike.git/src/pike_types.c:6900:    struct pike_type *res = NULL;    struct pike_type *prev = fun_type;    int cnt = 256;    /* This argument can expand to anything between zero and MAX_ARGS args. */       copy_pike_type(res, fun_type);       /* Loop until we get a stable fun_type, or it's an invalid argument. */    while ((fun_type = low_new_check_call(debug_malloc_pass(prev),    debug_malloc_pass(arg_type), -  flags, sval)) && +  flags|CALL_NOT_LAST_ARG, sval)) &&    (fun_type != prev) && --cnt) {      #ifdef PIKE_DEBUG    if (l_flag>4) {    fprintf(stderr, "\n sub_result_type: ");    simple_describe_type(fun_type);    }   #endif /* PIKE_DEBUG */       res = dmalloc_touch(struct pike_type *,
pike.git/src/pike_types.c:6965:    struct svalue *sval = NULL;       CHECK_COMPILER();       debug_malloc_touch(fun_type);       while (args &&    ((args->token == F_ARG_LIST) || (args->token == F_LVALUE_LIST)) &&    fun_type) {    if (args->token == F_LVALUE_LIST) flags |= CALL_ARG_LVALUE; -  fun_type = new_check_call(fun_name, fun_type, CAR(args), argno, flags); +  fun_type = new_check_call(fun_name, fun_type, CAR(args), argno, +  flags | (CDR(args)?CALL_NOT_LAST_ARG:0));    debug_malloc_touch(fun_type);    args = CDR(args);    }       if (!args || !fun_type) {    debug_malloc_touch(fun_type);    return fun_type;    }       (*argno)++;