pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:16:   #include "pike_types.h"   #include "fsort.h"   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "security.h"   #include "stuff.h"   #include "bignum.h"    - RCSID("$Id: array.c,v 1.60 2000/02/02 00:37:21 hubbe Exp $"); + RCSID("$Id: array.c,v 1.61 2000/02/17 18:57:36 hubbe Exp $");      struct array empty_array=   {    1, /* Never free */   #ifdef PIKE_SECURITY    0,   #endif    &empty_array, /* Next */    &empty_array, /* previous (circular) */    0, /* Size = 0 */
pike.git/src/array.c:448:   INT32 array_search(struct array *v, struct svalue *s,INT32 start)   {    INT32 e;   #ifdef PIKE_DEBUG    if(start<0)    fatal("Start of find_index is less than zero.\n");   #endif       check_destructed(s);    -  /* Why search for something that is not there? */ +    #ifdef PIKE_DEBUG    if(d_flag > 1) array_check_type_field(v);   #endif -  if(v->type_field & (1 << s->type)) +  /* Why search for something that is not there? +  * however, we must explicitly check for searches +  * for destructed objects/functions +  */ +  if((v->type_field & (1 << s->type)) || +  (IS_ZERO(s) && (v->type_field & (BIT_FUNCTION|BIT_OBJECT))))    {    if(start)    {    for(e=start;e<v->size;e++)    if(is_eq(ITEM(v)+e,s)) return e;    }else{    TYPE_FIELD t=0;    for(e=0;e<v->size;e++)    {    if(is_eq(ITEM(v)+e,s)) return e;