pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:9646:    }       return id_to_program((int)(ptrdiff_t)t->cdr);   }      /* NOTE: Does not add references to the return value! */   PMOD_EXPORT struct program *low_program_from_svalue(const struct svalue *s,    struct object **parent_obj,    int *parent_id)   { +  while(s) {    switch(TYPEOF(*s))    {    case T_OBJECT:    {    struct program *p = s->u.object->prog;   #if 0    int call_fun;   #endif       if (!p) return 0;
pike.git/src/program.c:9684:    if (SUBTYPEOF(*s) == FUNCTION_BUILTIN) return 0;    return low_program_from_function(*parent_obj = s->u.object,    *parent_id = SUBTYPEOF(*s));       case T_PROGRAM:    return s->u.program;       case PIKE_T_TYPE:    return program_from_type(s->u.type);    +  case PIKE_T_ARRAY: +  if (!s->u.array->size) break; +  /* Return result for the last element of the array. +  * +  * This is compatible with the corresponding behavior for inherit. +  */ +  s = ITEM(s->u.array) + s->u.array->size - 1; +  continue; +     default: -  return 0; +  break;    } -  +  +  break;    }    -  +  return NULL; + } +    /* NOTE: Does not add references to the return value! */   PMOD_EXPORT struct program *program_from_svalue(const struct svalue *s)   {    struct object *parent_obj = NULL;    int parent_id = -1;    return low_program_from_svalue(s, &parent_obj, &parent_id);   }      #define FIND_CHILD_HASHSIZE 5003   struct find_child_cache_s