Branch: Tag:

2017-12-28

2017-12-28 02:29:49 by Martin Nilsson <nilsson@fastmail.com>

Clean up stack in create

3667:    f_allocate(2);    to_arg = Pike_sp - 1;    } -  if (TYPEOF(*to_arg) != T_ARRAY) { +  else if (TYPEOF(*to_arg) != T_ARRAY) {    SIMPLE_ARG_TYPE_ERROR("replace", 2, "array(string)|string");    } -  if (from_arg->u.array->size != to_arg->u.array->size) { +  else if (from_arg->u.array->size != to_arg->u.array->size) {    Pike_error("Replace must have equal-sized from and to arrays.\n");    }    add_ref(THIS->from = from_arg->u.array);
3681:    THIS->from = mapping_indices(from_arg->u.mapping);    THIS->to = mapping_values(from_arg->u.mapping);    } else { +  pop_n_elems(args);    return;    }       if (!THIS->from->size) {    /* Enter no-op mode. */ -  +  pop_n_elems(args);    return;    }   
3699:    SIMPLE_ARG_TYPE_ERROR("replace", 2, "array(string)|string");       compile_replace_many(&THIS->ctx, THIS->from, THIS->to, 1); +  pop_n_elems(args);    }       /*! @decl string `()(string str)
3798:    THIS->to = NULL;    }    -  if (!del) return; +  if (!del) { +  pop_n_elems(args); +  return; +  }       if (!to) {    SIMPLE_ARG_TYPE_ERROR("replace", 2, "string");
3806:       if (del == to) {    /* No-op... */ +  pop_n_elems(args);    return;    }   
3815:    if (del->len) {    THIS->mojt = simple_compile_memsearcher(del);    } +  pop_n_elems(args);    }       /*** replace function ***/