Branch: Tag:

2021-02-04

2021-02-04 11:09:06 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: Use type_binop(PT_BINOP_MINUS) for pike_types_le().

8922:      int pike_types_le(struct pike_type *a,struct pike_type *b)   { -  int res; - #ifdef PIKE_DEBUG +     struct remap_state remap; -  struct pike_type *tmp, *tmp2; -  struct mapping *markers; +  struct pike_type *tmp, *tmp2 = NULL; + #ifdef PIKE_DEBUG +  int res;    struct pike_type **save_type_stackp = Pike_compiler->type_stackp;    struct pike_type ***save_mark_stackp = Pike_compiler->pike_type_mark_stackp; -  + #endif       memset(&remap, 0, sizeof(remap));       tmp = low_type_binop(PT_BINOP_MINUS, a, b, &remap, 0, 0, 0);    -  markers = allocate_mapping(10); +  if (tmp) { +  struct mapping *markers = allocate_mapping(10);    tmp2 = remap_markers(tmp, markers, NULL, PT_FLAG_REMAP_EVAL_MARKERS); - #endif +  free_mapping(markers); +  }    -  + #ifdef PIKE_DEBUG    clear_markers();    res = low_pike_types_le(a, b, 0, 0);    - #ifdef PIKE_DEBUG +     if ((save_type_stackp != Pike_compiler->type_stackp) ||    (save_mark_stackp != Pike_compiler->pike_type_mark_stackp) ||    (res != !tmp2)) {
8975:       free_type(tmp3);    } + #endif       free_type(tmp);    free_type(tmp2); -  free_mapping(markers); - #endif +     -  return res; +  return !tmp2;   }      int check_variant_overload(struct pike_type *a, struct pike_type *b)