pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1845:   PMOD_EXPORT struct program *proxy_factory(struct program *p,    const char *var_name,    int program_id)   {    struct array *a;    int i = 0;    struct pike_type *fun_type;    union idptr ptr;    int j;    struct svalue *cached; +  struct pike_string *var_string = NULL;    int var_flags = ID_LOCAL;       ref_push_program(p);    if (proxy_lookup &&    (cached = low_mapping_lookup(proxy_lookup, Pike_sp-1))) {    /* NB: This cache isn't a 100% sound, as it doesn't    * take into account var_name and program_id.    * On the other hand they are only available by    * calling this function directly, ie by C-code    * that presumably knows what it is doing.
pike.git/src/builtin.cmod:1899:       /* Reference #0: The variable that we store the proxied object in. */    /* NB: Use a name that will not clash. */    if (var_name) {    push_text(var_name);    var_flags = ID_LOCAL;    } else {    push_string(make_shared_static_string("proxied_obj\0", 12, eightbit));    var_flags = ID_LOCAL|ID_PROTECTED|ID_PRIVATE|ID_HIDDEN;    } +  var_string = Pike_sp[-1].u.string;    type_stack_mark();    push_object_type(0, p->id);    fun_type = pop_unfinished_type(); -  define_variable(Pike_sp[-1].u.string, fun_type, var_flags); +  define_variable(var_string, fun_type, var_flags);    free_type(fun_type);    pop_stack();       /* Add proxy functions for the references. */    for (i = 0; i < p->num_identifier_references; i++) {    struct reference *ref = PTR_FROM_INT(p, i);    struct identifier *id;    if (ref->id_flags & ID_HIDDEN) continue;    id = ID_FROM_PTR(p, ref); -  +  if (id->name == var_string) continue; /* Reserved. */    if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) {    /* Handle in second pass. */    yyerror("Aliases not supported (yet).");    } else if (IDENTIFIER_IS_VARIABLE(id->identifier_flags) ||    IDENTIFIER_IS_CONSTANT(id->identifier_flags)) {    struct pike_string *fun_name;       /* Getter. */    type_stack_mark();    push_finished_type(id->type);