pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:5122:   {    node **arg0 = my_get_arg(&_CDR(n), 0);    struct pike_type *array_zero;    struct pike_type *mapping_zero;       if (!arg0) return NULL;       MAKE_CONSTANT_TYPE(array_zero, tArr(tZero));    MAKE_CONSTANT_TYPE(mapping_zero, tMap(tZero, tZero));    -  if ((pike_types_le(array_zero, (*arg0)->type) || -  pike_types_le(mapping_zero, (*arg0)->type))) { +  if ((pike_types_le(array_zero, (*arg0)->type, 0, 0) || +  pike_types_le(mapping_zero, (*arg0)->type, 0, 0))) {    /* First argument might be an array or a mapping.    *    * replace() is destructive on arrays and mappings.    */    n->node_info |= OPT_SIDE_EFFECT;    n->tree_info |= OPT_SIDE_EFFECT;    } else {    /* First argument is not an array or mapping,    *    * It must thus be a string.    */    node **arg1 = my_get_arg(&_CDR(n), 1);    node **arg2 = my_get_arg(&_CDR(n), 2);       /* This variable is modified in between setjmp and longjmp,    * so it needs to be volatile to prevent it from being globbered.    */    struct program * volatile replace_compiler = NULL;    -  if (arg1 && ((pike_types_le((*arg1)->type, array_type_string) && +  if (arg1 && ((pike_types_le((*arg1)->type, array_type_string, 0, 0) &&    arg2 && -  (pike_types_le((*arg2)->type, array_type_string) || -  pike_types_le((*arg2)->type, string_type_string))) || -  (pike_types_le((*arg1)->type, mapping_type_string)))) { +  (pike_types_le((*arg2)->type, array_type_string, 0, 0) || +  pike_types_le((*arg2)->type, string_type_string, 0, 0))) || +  (pike_types_le((*arg1)->type, mapping_type_string, 0, 0)))) {    /* Handle the cases:    *    * replace(string, array, array)    * replace(string, array, string)    * replace(string, mapping(string:string))    */    extern struct program *multi_string_replace_program;    replace_compiler = multi_string_replace_program; -  } else if (arg1 && pike_types_le((*arg1)->type, string_type_string) && -  arg2 && pike_types_le((*arg2)->type, string_type_string)) { +  } else if (arg1 && pike_types_le((*arg1)->type, string_type_string, 0, 0) && +  arg2 && pike_types_le((*arg2)->type, string_type_string, 0, 0)) {    extern struct program *single_string_replace_program;    replace_compiler = single_string_replace_program;    }    if (replace_compiler && !is_const(*arg0) && is_const(*arg1) &&    (!arg2 || is_const(*arg2))) {    /* The second and third (if any) arguments are constants. */    struct svalue *save_sp = Pike_sp;    JMP_BUF tmp;    if (SETJMP(tmp)) {    struct svalue thrown;