Branch: Tag:

1998-04-28

1998-04-28 07:47:17 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

bugfix in type or:ing

Rev: src/pike_types.c:1.42

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: pike_types.c,v 1.41 1998/04/24 00:08:42 hubbe Exp $"); + RCSID("$Id: pike_types.c,v 1.42 1998/04/28 07:47:17 hubbe Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"
712:    }       case T_ARRAY: +  my_strcat("array");    if(EXTRACT_UCHAR(t)==T_MIXED)    { -  my_strcat("array"); +     t++;    }else{ -  +  my_strcat("(");    t=low_describe_type(t); -  my_strcat("*"); +  my_strcat(")");    }    break;   
896:   #define A_EXACT 1   #define B_EXACT 2   #define NO_MAX_ARGS 4 + #define NO_SHORTCUTS 8      /*    * match two type strings, return zero if they don't match, and return
919:    case T_OR:    a++;    ret=low_match_types(a,b,flags); -  if(ret) return ret; +  if(ret && !(flags & NO_SHORTCUTS)) return ret;    a+=type_length(a); -  +  if(ret) +  { +  low_match_types(a,b,flags); +  return ret; +  }else{    return low_match_types(a,b,flags); -  +  }       case T_NOT:    if(low_match_types(a+1,b,(flags ^ B_EXACT ) | NO_MAX_ARGS))
963:    case T_OR:    b++;    ret=low_match_types(a,b,flags); -  if(ret) return ret; +  if(ret && !(flags & NO_SHORTCUTS)) return ret;    b+=type_length(b); -  +  if(ret) +  { +  low_match_types(a,b,flags); +  return ret; +  }else{    return low_match_types(a,b,flags); -  +  }       case T_NOT:    if(low_match_types(a,b+1, (flags ^ A_EXACT ) | NO_MAX_ARGS))
1193:    return 1;    }    -  a=low_match_types(a,b,0); +  a=low_match_types(a,b,NO_SHORTCUTS);    if(a)    {    switch(EXTRACT_UCHAR(a))