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.173 2004/09/30 14:00:13 mast Exp $ + || $Id: array.c,v 1.174 2004/10/16 07:27:30 agehall 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:75:    struct array *v;    ptrdiff_t e;       if(size+extra_space == 0)    {    add_ref(&empty_array);    return &empty_array;    }       /* Limits size to (1<<29)-4 */ -  if( (size+extra_space-1) > +  if( (size_t)(size+extra_space-1) >    (LONG_MAX-sizeof(struct array))/sizeof(struct svalue) )    Pike_error("Too large array (size %ld exceeds %ld).\n",    (long)(size+extra_space-1),    (long)((LONG_MAX-sizeof(struct array))/sizeof(struct svalue)) );    v=(struct array *)malloc(sizeof(struct array)+    (size+extra_space-1)*sizeof(struct svalue));    if(!v)    Pike_error(msg_out_of_mem);       GC_ALLOC(v);