pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:3698:   }            /******/      /*    * match two type strings, return zero if they don't match, and return    * the part of 'a' that _did_ match if it did.    */ - #ifdef PIKE_TYPE_DEBUG +    static struct pike_type *low_match_types2(struct pike_type *a,    struct pike_type *b,    int flags); - #endif +    static struct pike_type *low_match_types(struct pike_type *a,    struct pike_type *b,    int flags) - #ifdef PIKE_TYPE_DEBUG +    { -  +  struct pike_type *ret = NULL; +  DECLARE_CYCLIC(); + #ifdef PIKE_TYPE_DEBUG    int e;    char *s;       if (l_flag>2) {    fprintf(stderr, "%*slow_match_types(", indent*2, "");    simple_describe_type(a);    fprintf(stderr, ",\n");    fprintf(stderr, "%*s%s", indent*2, "", " ");    simple_describe_type(b);    fprintf(stderr, ",\n");
pike.git/src/pike_types.cmod:3753:    }    fprintf(stderr, "NO_SHORTCUTS");    f = 1;    }    } else {    fputc('0', stderr);    }    fprintf(stderr, ");\n");    indent++;    } + #endif    -  a = low_match_types2(a, b, flags); +  if ((a == b) || (!a)) { +  ret = a; +  } else { +  ret = BEGIN_CYCLIC(a, b); +  if (!ret) { +  SET_CYCLIC_RET(a);    -  +  ret = low_match_types2(a, b, flags); +  } +  END_CYCLIC(); +  } +  + #ifdef PIKE_TYPE_DEBUG    if (l_flag>2) {    indent--;    fprintf(stderr, "%*s= ", indent*2, ""); -  if(a) -  simple_describe_type(a); +  if(ret) +  simple_describe_type(ret);    else    fprintf(stderr, "NULL");    fputc('\n', stderr);    } -  return a; + #endif +  return ret;   }      static struct pike_type *low_match_types2(struct pike_type *a,    struct pike_type *b,    int flags) - #endif +    {    int correct_args;    struct pike_type *ret; -  if(a == b) return a; +       #ifdef PIKE_DEBUG    fatal_check_c_stack(1024);   #endif       switch(a->type & 0xff)    {    case T_AND:    ret = low_match_types(a->car, b, flags);    if(!ret) return 0;