Branch: Tag:

2003-11-09

2003-11-09 02:40:42 by Martin Stjernholm <mast@lysator.liu.se>

Fixed typos and checks that caused overoptimizations on types when there are
objects in the arrays.

Rev: src/array.c:1.152

2:   || 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.151 2003/11/09 01:10:13 mast Exp $ + || $Id: array.c,v 1.152 2003/11/09 02:40:42 mast Exp $   */      #include "global.h"
26:   #include "cyclic.h"   #include "multiset.h"    - RCSID("$Id: array.c,v 1.151 2003/11/09 01:10:13 mast Exp $"); + RCSID("$Id: array.c,v 1.152 2003/11/09 02:40:42 mast Exp $");      PMOD_EXPORT struct array empty_array=   {
1133:   #endif       /* objects may have `< `> operators, evil stuff! */ -  if(s->type != T_OBJECT && !(a->flags & BIT_OBJECT)) +  if(s->type != T_OBJECT && !(a->type_field & BIT_OBJECT))    {    /* face it, it's not there */    if( (((2 << s->type) -1) & a->type_field) == 0)
1154:    if(d_flag > 1) array_check_type_field(a);   #endif    /* objects may have `< `> operators, evil stuff! */ -  if(s->type != T_OBJECT && !(a->flags & BIT_OBJECT)) +  if(s->type != T_OBJECT && !(a->type_field & BIT_OBJECT))    {    if( (((2 << s->type) -1) & a->type_field) == 0)    return -1;
1321: Inside #if defined(PIKE_DEBUG)
   array_check_type_field(b);    }   #endif -  if(!(a->type_field & b->type_field)) +  if(!(a->type_field & b->type_field) && +  !((a->type_field | b->type_field) & BIT_OBJECT))    {    /* do smart optimizations */    switch(opcode)
1747:   #endif    check_array_for_destruct(a);    -  if(a->type_field & b->type_field) +  if((a->type_field & b->type_field) || +  ((a->type_field | b->type_field) & BIT_OBJECT))    {    return merge_array_with_order(a, b, PIKE_ARRAY_OP_SUB);    }else{
1771:   #endif    check_array_for_destruct(a);    -  if(a->type_field & b->type_field) +  if((a->type_field & b->type_field) || +  ((a->type_field | b->type_field) & BIT_OBJECT))    {    return merge_array_with_order(a, b, PIKE_ARRAY_OP_AND_LEFT);    }else{