Branch: Tag:

2014-12-04

2014-12-04 19:23:30 by Martin Nilsson <nilsson@opera.com>

Fixed bugs found by dmalloc.

2053:    {    /* We only need to do anything if the value exists in the array. */    ssize_t off = fast_array_search( a, b, 0 ); +  TYPE_FIELD tmp;       if( off == -1 )    /* We still need to return a new array. */
2061:    /* In this case we generate a new array and modify that one. */    destructive = 0;    from = (size_t)off; +  tmp = a->type_field;    a = allocate_array_no_init(size-1,0); -  +  a->type_field = tmp;    SET_ONERROR( ouch, do_free_array, a );    dp = ITEM(a);   
2108:    }    else /* b does not exist in the array. */    { -  a->refs++; +  add_ref(a);    return a;    }   #undef MATCH_COPY
2122:    if( !destructive )    UNSET_ONERROR( ouch );    else -  a->refs++; +  add_ref(a);    -  +  if( a->size )    return a; -  +  +  free_array(a); +  add_ref(&empty_array); +  return &empty_array;   }      /** Subtract an array from another.