pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.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: pike_types.c,v 1.354 2008/09/09 13:03:02 mast Exp $ + || $Id: pike_types.c,v 1.355 2008/09/11 11:46:13 grubba Exp $   */      #include "global.h"   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"
pike.git/src/pike_types.c:3780:    switch(a->type)    {    case T_AND:    /* OK if either of the parts is a subset. */    /* FIXME: What if b also contains an AND? */    ret = low_pike_types_le(a->car, b, array_cnt, flags);    if(!ret) {    a = a->cdr;    goto recurse;    } -  /* Note that we need to recurse, since there may be T_ASSIGN nodes +  if ((a->flags | b->flags) & PT_FLAG_ASSIGN) { +  /* Note that we need to recurse, since there are T_ASSIGN nodes    * in the cdr that need to be executed.    */    low_pike_types_le(a->cdr, b, array_cnt, flags); -  +  }    return 1;       case T_OR:    /* OK, if both of the parts are a subset,    * unless we are grouped, in which case    * only one part needs to be a subset.    */    if (a->car->type == T_VOID) {    /* Special case for T_VOID */    /* FIXME: Should probably be handled as T_ZERO. */   #ifdef TYPE_GROUPING    if (flags & LE_A_GROUPED) return 1;   #endif    a = a->cdr;    goto recurse;    } else {    ret = low_pike_types_le(a->car, b, array_cnt, flags);   #ifdef TYPE_GROUPING    if (!ret == !(flags & LE_A_GROUPED)) { -  +  if ((a->flags | b->flags) & PT_FLAG_ASSIGN) {    /* Note: Needed for side effects... */    low_pike_types_le(a->cdr, b, array_cnt, flags); -  +  }    return ret;    }   #else    if (!ret) return 0;   #endif    if (a->cdr->type == T_VOID) {    /* Special case for T_VOID */    /* FIXME: Should probably be handled as T_ZERO. */    return 1;    } else {
pike.git/src/pike_types.c:3999:    goto recurse;       case T_OR:    /* OK if a is a subset of either of the parts,    * unless we are grouped, in which case both    * parts need to be a subset.    */    ret = low_pike_types_le(a, b->car, array_cnt, flags);   #ifdef TYPE_GROUPING    if (!ret != !(flags & LE_B_GROUPED)) { +  if ((a->flags | b->flags) & PT_FLAG_ASSIGN) {    low_pike_types_le(a, b->cdr, array_cnt, flags); -  +  }    return ret;    }   #else    if (ret) return ret;   #endif    b = b->cdr;    goto recurse;       case PIKE_T_RING:    b = b->car;