pike.git / src / las.cmod

version» Context lines:

pike.git/src/las.cmod:432:    {    if(!pike_type_allow_premature_toss(    Pike_compiler->compiler_frame->variable[e].type))    return 0;    }    return 1;   }      static int check_node_type(node *n, struct pike_type *t, const char *msg)   { + #if 1 +  struct pike_type *diff = type_binop(PT_BINOP_MINUS, n->type, t, +  0, PT_FLAG_CMP_NULLABLE, 0); +  if (!diff) return 1; /* Strict match. */ +  if (diff == n->type) { +  /* Strict mismatch. */ +  yytype_report(REPORT_ERROR, NULL, 0, t, NULL, 0, diff, 0, msg); +  free_type(diff); +  /* print_tree(n); */ +  return 0; +  } +  if (THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES) { +  yytype_report(REPORT_WARNING, NULL, 0, t, NULL, 0, diff, 0, msg); +  } +  free_type(diff); + #else    if (pike_types_le(n->type, t)) return 1;    if (!match_types(n->type, t)) {    yytype_report(REPORT_ERROR, NULL, 0, t, NULL, 0, n->type, 0, msg);    return 0;    }    if (THIS_COMPILATION->lex.pragmas & ID_STRICT_TYPES) {    yytype_report(REPORT_WARNING, NULL, 0, t, NULL, 0, n->type, 0, msg);    } -  + #endif    if (runtime_options & RUNTIME_CHECK_TYPES) {    node *p = n->parent;    if (p && (CAR(p) == n)) {    (_CAR(p) = mksoftcastnode(t, mkcastnode(mixed_type_string, n)))    ->parent = p;    } else if (p && (CDR(p) == n)) {    (_CDR(p) = mksoftcastnode(t, mkcastnode(mixed_type_string, n)))    ->parent = p;    } else {    yywarning("Failed to find place to insert soft cast.");