Branch: Tag:

2002-05-28

2002-05-28 15:23:03 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed bug in low_allocate_array().

Rev: src/array.c:1.126

22:   #include "security.h"   #include "stuff.h"   #include "bignum.h" + #include "cyclic.h"    - RCSID("$Id: array.c,v 1.125 2002/05/10 23:35:06 nilsson Exp $"); + RCSID("$Id: array.c,v 1.126 2002/05/28 15:23:03 grubba Exp $");      PMOD_EXPORT struct array empty_array=   {
72:    struct array *v;    ptrdiff_t e;    -  if(size == 0) +  if(size+extra_space == 0)    {    add_ref(&empty_array);    return &empty_array;
1935:    INT32 e;    struct svalue *argp = Pike_sp-args;    TYPE_FIELD new_types = 0; +  struct array *cycl; +  DECLARE_CYCLIC();       check_array_for_destruct(a);    check_stack(120 + args + 1);    -  +  /* FIXME: Ought to use a better key on the arguments below. */ +  if (!(cycl = (struct array *)BEGIN_CYCLIC(a, args))) {    BEGIN_AGGREGATE_ARRAY(a->size) { -  +  SET_CYCLIC_RET(Pike_sp[-1].u.array);    for (e=0;e<a->size;e++) {    assign_svalues_no_free(Pike_sp, argp, args, BIT_MIXED);    Pike_sp+=args;
1953: Inside #if defined(PIKE_DEBUG)
  #ifdef PIKE_DEBUG    array_check_type_field(Pike_sp[-1].u.array);   #endif +  } else { +  ref_push_array(cycl); +  } +  END_CYCLIC();    stack_pop_n_elems_keep_top(args);   }