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.136

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.135 2003/09/08 15:28:14 mast Exp $ + || $Id: array.c,v 1.136 2003/11/09 02:40:42 mast Exp $   */      #include "global.h"
25:   #include "bignum.h"   #include "cyclic.h"    - RCSID("$Id: array.c,v 1.135 2003/09/08 15:28:14 mast Exp $"); + RCSID("$Id: array.c,v 1.136 2003/11/09 02:40:42 mast Exp $");      PMOD_EXPORT struct array empty_array=   {
953:   #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)
974:    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;
1127: 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)
1558:   #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{
1582:   #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{