pike.git / src / array.c

version» Context lines:

pike.git/src/array.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: array.c,v 1.143 2003/04/28 00:32:42 mast Exp $ + || $Id: array.c,v 1.144 2003/04/28 17:15:35 mast Exp $   */      #include "global.h"   #include "svalue.h"   #include "array.h"   #include "object.h"   #include "las.h"   #include "stralloc.h"   #include "interpret.h"   #include "opcodes.h"
pike.git/src/array.c:19:   #include "builtin_functions.h"   #include "pike_memory.h"   #include "gc.h"   #include "main.h"   #include "security.h"   #include "stuff.h"   #include "bignum.h"   #include "cyclic.h"   #include "multiset.h"    - RCSID("$Id: array.c,v 1.143 2003/04/28 00:32:42 mast Exp $"); + RCSID("$Id: array.c,v 1.144 2003/04/28 17:15:35 mast Exp $");      PMOD_EXPORT struct array empty_array=   {    PIKE_CONSTANT_MEMOBJ_INIT(1), /* Never free */    &weak_empty_array, /* Next */    &weak_shrink_empty_array, /* previous (circular) */    0, /* Size = 0 */    0, /* malloced Size = 0 */    0, /* no types */    0, /* no flags */
pike.git/src/array.c:266:    index_error(0,0,0,&tmp,ind,"Index %d is out of array range 0 - %d.\n", i, a->size-1);    } else {    index_error(0,0,0,&tmp,ind,"Attempt to index the empty array with %d.\n", i);    }    }    array_index_no_free(s,a,i);    break;       case T_STRING:    { -  s->type = T_ARRAY; +  /* Set the type afterwards to avoid a clobbered svalue in case +  * array_column throws. */    s->u.array = array_column (a, ind); -  +  s->type = T_ARRAY;    break;    }       default:    {    struct svalue tmp;    tmp.type=T_ARRAY;    tmp.u.array=a;    index_error(0,0,0,&tmp,ind,"Array index is neither int nor string.\n");    }