pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:11924:    } else {    struct pike_type *bin_t =    low_type_binop((flags & CALL_INVERTED_TYPES)?    PT_BINOP_INVERSE_MINUS:    PT_BINOP_MINUS,    arg_type, tmp2, &remap,    PT_FLAG_CMP_VOID_IS_ZERO,    PT_FLAG_CMP_VOID_IS_ZERO,    remap_flags|PT_FLAG_REMAP_EVAL_MARKERS);    -  /* Legend for mismatch: -  * 0 - Strict match. -  * 1 - Partial match. -  * 3 - Strict mismatch. -  */ -  int mismatch = bin_t?((bin_t == arg_type)?3:1):0; -  int mask = (flags & (CALL_INVERTED_TYPES|CALL_STRICT))?3:2; +  if (bin_t) { +  /* Partial or strict mismatch. */    free_type(bin_t);    -  if (mismatch & mask) { +  if (flags & (CALL_INVERTED_TYPES|CALL_STRICT)) { +  goto no_match; +  } +  +  /* Partial matches allowed. */ +  +  bin_t = low_type_binop(PT_BINOP_AND, +  arg_type, tmp2, &remap, +  PT_FLAG_CMP_VOID_IS_ZERO, +  PT_FLAG_CMP_VOID_IS_ZERO, +  remap_flags); +  +  if (!bin_t) {    no_match:    /* No match. */   #ifdef PIKE_DEBUG    if (l_flag>2) {    fprintf(stderr, "%*sNo match.\n", indent*2+2, "");    }   #endif /* PIKE_DEBUG */    res = NULL;    if (tmp) free_type(tmp);       EXIT_REMAP_STATE(remap);       break;    } -  +  +  free_type(bin_t);    }    } -  +  }       /* Match. */    if (fun_type->type == PIKE_T_FUNCTION) {    struct pike_type *t = NULL;    /* Advance to the next argument. */    fun_cont = fun_type->cdr;    } else {    fun_cont = fun_type;    }