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.209 2008/05/30 15:19:02 mast Exp $ + || $Id: array.c,v 1.210 2008/06/23 16:05:02 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:2278:    if(!del->len)    {    ret=allocate_array_no_init(str->len,0);    for(e=0;e<str->len;e++)    {    ITEM(ret)[e].type=T_STRING;    ITEM(ret)[e].u.string=string_slice(str,e,1);    }    }else{    SearchMojt mojt; +  ONERROR uwp;    explode_searchfunc f = (explode_searchfunc)0;       s=str->str;    end=s+(str->len << str->size_shift);       ret=allocate_array(10);    ret->size=0;       mojt=compile_memsearcher(MKPCHARP_STR(del),    del->len,    str->len,    del); -  +  SET_ONERROR (uwp, do_free_object, mojt.container);       switch(str->size_shift)    {    case 0: f=(explode_searchfunc)mojt.vtab->func0; break;    case 1: f=(explode_searchfunc)mojt.vtab->func1; break;    case 2: f=(explode_searchfunc)mojt.vtab->func2; break;   #ifdef PIKE_DEBUG    default: Pike_fatal("Illegal shift.\n");   #endif    }
pike.git/src/array.c:2336:    } END_ACCEPT_UNFINISHED_TYPE_FIELDS;    ret->size=e;    }       ITEM(ret)[ret->size].u.string=string_slice(str,    (s-str->str)>>str->size_shift,    (end-s)>>str->size_shift);       ITEM(ret)[ret->size].type=T_STRING;    ret->size++; -  mojt.vtab->freeme(mojt.data); +  +  CALL_AND_UNSET_ONERROR (uwp);    }    ret->type_field=BIT_STRING;    return ret;   }      /** Implode an array by creating a string with all of the array's    * elements separated by a delimiter.    *    * @param a The array containing elements to be imploded    * @param del The delimiter used to separate the array's elements in the resulting string