pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:7170:    if ((lfun_type = low_mapping_string_lookup(lfun_types, name))) {    int orig_pragmas = c->lex.pragmas;   #ifdef PIKE_DEBUG    if (TYPEOF(*lfun_type) != T_TYPE) {    Pike_fatal("Bad entry in lfun_types for key \"%s\"\n", name->str);    }   #endif /* PIKE_DEBUG */    if (Pike_compiler->compiler_pass == COMPILER_PASS_LAST) {    struct svalue *lfun_id = low_mapping_string_lookup(lfun_ids, name);    enum pt_cmp_flags aflags = 0; +  struct pike_type *tmp_type = NULL;    if (lfun_id && (TYPEOF(*lfun_id) == PIKE_T_INT)) {    if (lfun_compat_strings[lfun_id->u.integer] == name) {    /* Compat lfun.    *    * Check if we actually have an lfun.    *    * NB: We're in the last pass, so all symbols should be    * present (at least for the Pike code case).    */    if ((lfun_id->u.integer >= LFUN__ITERATOR_NEXT_FUN) &&
pike.git/src/program.c:7212:    }    if (!IDENTIFIER_IS_C_FUNCTION(function_flags)) {    /* Functions compiled by the Pike compiler    * ignore extra arguments, so do not complain    * if they are missing.    */    aflags |= PT_FLAG_CMP_IGNORE_EXTRA_ARGS;    }    /* Inhibit deprecation warnings during the comparison. */    c->lex.pragmas |= ID_NO_DEPRECATION_WARNINGS; -  if (!pike_types_le(type, lfun_type->u.type, aflags, 0)) { +  +  tmp_type = type_binop(PT_BINOP_MINUS, type, lfun_type->u.type, +  aflags, 0, 0); +  if (tmp_type) {    int level = REPORT_NOTICE; -  if (!match_types(type, lfun_type->u.type)) { +  +  free_type(tmp_type); +  tmp_type = type_binop(PT_BINOP_AND, type, lfun_type->u.type, +  aflags, 0, 0); +  if (!tmp_type) {    level = REPORT_ERROR;    } else if (c->lex.pragmas & ID_STRICT_TYPES) {    level = REPORT_WARNING;    } -  +  +  free_type(tmp_type); +     if (level != REPORT_NOTICE) {    yytype_report(level,    NULL, 0, lfun_type->u.type,    NULL, 0, type,    0, "Type mismatch for callback function %S:", name);    }    }    c->lex.pragmas = orig_pragmas;       /* NB: define_function() is called multiple times... */