pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:3923:    dispatch_fun.c_fun = f_dispatch_variant;       /* Collect variant functions that have been defined in this program,    * and add the corresponding dispatchers.    */    for (e = 0; e < num_refs; e++) {    struct identifier *id;    struct pike_string *name;    struct pike_type *type;    int id_flags; +  int opt_flags;    int j;    if (prog->identifier_references[e].inherit_offset) continue;    if (!is_variant_dispatcher(prog, e)) continue;    /* Found a dispatcher. */       id = ID_FROM_INT(prog, e);    name = id->name;    type = NULL;    id_flags = 0; -  +  opt_flags = 0;       CDFPRINTF((stderr, "Collecting variants of \"%s\"...\n", name->str));       /* Collect the variants of the function. */    j = prog->num_identifier_references;    while ((j = really_low_find_variant_identifier(name, prog, NULL, j,    SEE_PROTECTED|SEE_PRIVATE)) >= 0) {    struct reference *ref = prog->identifier_references + j;    id = ID_FROM_INT(prog, j);    id_flags |= ref->id_flags; -  +  opt_flags |= id->opt_flags;    /* NB: The dispatcher needs the variant references to    * not get overloaded for the ::-operator to work.    */    prog->identifier_references[j].id_flags |= ID_LOCAL;    {    struct pike_type * temp = type;    type = or_pike_types(type, id->type, 1);    if (temp) free_type(temp);    }   #ifdef COMPILER_DEBUG
pike.git/src/program.c:3966: Inside #if defined(COMPILER_DEBUG)
   }   #ifdef COMPILER_DEBUG    fprintf(stderr, "Dispatcher type: ");    simple_describe_type(type);    fprintf(stderr, "\n");   #endif    /* Update the type of the dispatcher. */    id = ID_FROM_INT(prog, e);    free_type(id->type);    id->type = type; +  id->opt_flags = opt_flags;    prog->identifier_references->id_flags |= id_flags & ~(ID_VARIANT|ID_LOCAL);    next_ref:    ;    }       debug_malloc_touch(Pike_compiler->fake_object);    debug_malloc_touch(Pike_compiler->fake_object->storage);       MAKE_CONST_STRING(s,"__INIT");