pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:2004:    struct pike_type *type,    struct pike_string *name,    unsigned int modifier_flags,    unsigned int identifier_flags,    unsigned int opt_flags,    union idptr func,    int run_time_type)   {    struct reference ref;    struct identifier dummy; +  int zap_type = 0;    int n;       if (modifier_flags & ID_PRIVATE) modifier_flags |= ID_LOCAL|ID_PROTECTED;       if (((identifier_flags & (IDENTIFIER_VARIABLE|IDENTIFIER_ALIAS)) ==    IDENTIFIER_VARIABLE) &&    (modifier_flags & ID_WEAK)) {    identifier_flags |= IDENTIFIER_WEAK;    }    -  +  if ((identifier_flags & IDENTIFIER_WEAK) && (!type || !(type->flags & PT_FLAG_NULLABLE))) { +  type_stack_mark(); +  push_finished_type(type); +  push_type(PIKE_T_ZERO); +  push_type(T_OR); +  +  type = pop_unfinished_type(); +  zap_type = 1; +  } +     ref.id_flags = modifier_flags;    ref.identifier_offset =    low_add_identifier(c, type, name,    identifier_flags, opt_flags,    func, run_time_type);    ref.inherit_offset = 0;    ref.run_time_type = PIKE_T_UNKNOWN;    -  +  if (zap_type) { +  free_type(type); +  } +     if ((identifier_flags & (IDENTIFIER_VARIABLE|IDENTIFIER_ALIAS)) ==    IDENTIFIER_VARIABLE) {    add_to_variable_index(ref.identifier_offset);    }       n = Pike_compiler->new_program->num_identifier_references;    add_to_identifier_references(ref);       return n;   }
pike.git/src/program.c:6625:       if(Pike_compiler->new_program->flags & PROGRAM_PASS_1_DONE)    {    if(n==-1)    yyerror("Pass2: Variable disappeared!");    else {    struct reference *ref = PTR_FROM_INT(Pike_compiler->new_program, n);    struct identifier *id = ID_FROM_PTR(Pike_compiler->new_program, ref);       free_type(id->type); +  if ((flags & ID_WEAK) && (!type || !(type->flags & PT_FLAG_NULLABLE))) { +  type_stack_mark(); +  push_finished_type(type); +  push_type(PIKE_T_ZERO); +  push_type(T_OR); +  +  id->type = pop_unfinished_type(); +  } else {    copy_pike_type(id->type, type); -  +  }    return n;    }    }      #ifdef PIKE_DEBUG    if(Pike_compiler->new_program->flags & (PROGRAM_FIXED | PROGRAM_OPTIMIZED))    Pike_fatal("Attempting to add variable to fixed program\n");   #endif       if(n != -1)