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.230 2004/01/28 13:59:10 grubba Exp $ + || $Id: pike_types.c,v 1.231 2004/03/10 18:08:12 grubba Exp $   */      #include "global.h" - RCSID("$Id: pike_types.c,v 1.230 2004/01/28 13:59:10 grubba Exp $"); + RCSID("$Id: pike_types.c,v 1.231 2004/03/10 18:08:12 grubba Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"   #include "constants.h"   #include "object.h"   #include "multiset.h"   #include "mapping.h"   #include "pike_macros.h"   #include "pike_error.h"   #include "las.h"   #include "language.h"   #include "lex.h"   #include "pike_memory.h"   #include "bignum.h"   #include "main.h"   #include "opcodes.h" -  + #include "cyclic.h"   #include "block_alloc.h"      #ifdef PIKE_DEBUG   #define PIKE_TYPE_DEBUG   #endif /* PIKE_DEBUG */      /*    * Flags used by low_match_types().    */   #define A_EXACT 1
pike.git/src/pike_types.c:4449:    return FIND_LFUN(p, lfun)!=-1;    }    }   }         void yyexplain_nonmatching_types(struct pike_type *type_a,    struct pike_type *type_b,    int flags)   { +  DECLARE_CYCLIC(); +     implements_a=0;    implements_b=0;    implements_mode=0;       match_types(type_a, type_b);      #if 0    if(!(implements_a && implements_b &&    type_a->str[0]==T_OBJECT &&    type_b->str[0]==T_OBJECT))
pike.git/src/pike_types.c:4476:    yywarning("Expected: %s",s1->str);    yywarning("Got : %s",s2->str);    }else{    my_yyerror("Expected: %s",s1->str);    my_yyerror("Got : %s",s2->str);    }    free_string(s1);    free_string(s2);    }    +  /* Protect against circularities. */ +  if (BEGIN_CYCLIC(type_a, type_b)) { +  END_CYCLIC(); +  return; +  } +  SET_CYCLIC_RET(1); +     if(implements_a && implements_b) {    if (implements_mode) {    yyexplain_not_implements(implements_a, implements_b, flags);    } else {    yyexplain_not_compatible(implements_a, implements_b, flags);    }    } -  +  END_CYCLIC();   }         /******/      #ifdef DEBUG_MALLOC   #define low_make_pike_type(T,C) ((struct pike_type *)debug_malloc_pass(debug_low_make_pike_type(T,C)))   #define low_make_function_type(T,C) ((struct pike_type *)debug_malloc_pass(debug_low_make_function_type(T,C)))   #else /* !DEBUG_MALLOC */   #define low_make_pike_type debug_low_make_pike_type