Branch: Tag:

2014-02-17

2014-02-17 08:47:50 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Serializer.Serializable: Avoid getters and setters.

There's no need to encode the contents of getters and setters,
and they may be implemented via serialize(), in which case an
infinite loop (albeit detected) is likely to occur.

4681:    */   PIKECLASS Serializable   { -  /* Loop over all variables, and call fun_num in the current object. */ +  /* Loop over all true variables, and call fun_num in the current object. */    static void low_serialize(int i, struct svalue *fun,    int use_setter, int fun_num)    {
4701:    continue;    }    id = ID_FROM_PTR(p, ref); -  if (!IDENTIFIER_IS_VARIABLE(id->identifier_flags)) { +  if (!IDENTIFIER_IS_VARIABLE(id->identifier_flags) || +  (id->run_time_type == PIKE_T_GET_SET)) {    continue;    }    push_svalue(fun);