Branch: Tag:

2001-02-09

2001-02-09 17:30:23 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

limited tailrecursion to assure mutex functionality

Rev: src/las.c:1.233
Rev: src/las.h:1.46
Rev: src/peep.in:1.47
Rev: src/pike_types.c:1.146
Rev: src/pike_types.h:1.47

5:   \*/   /**/   #include "global.h" - RCSID("$Id: pike_types.c,v 1.145 2000/12/05 21:08:20 per Exp $"); + RCSID("$Id: pike_types.c,v 1.146 2001/02/09 17:30:22 hubbe Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"
3504:   {    return make_shared_binary_string(t, type_length(t));   } +  +  + int pike_type_allow_premature_toss(char *type) + { +  again: +  switch(EXTRACT_UCHAR(type++)) +  { +  case T_NOT: +  return !pike_type_allow_premature_toss(type); +  +  case T_OBJECT: +  case T_MIXED: +  case T_FUNCTION: +  return 0; +  +  case T_SCOPE: +  case T_ASSIGN: +  type++; +  goto again; +  +  case T_OR: +  case T_MAPPING: +  if(!pike_type_allow_premature_toss(type)) return 0; +  case T_AND: +  type+=type_length(type); +  case T_ARRAY: +  case T_MULTISET: +  goto again; +  +  case T_PROGRAM: +  case T_INT: +  case T_FLOAT: +  case T_STRING: +  return 1; +  } + }