Branch: Tag:

2015-01-27

2015-01-27 17:14:40 by Arne Goedeke <el@laramies.com>

equal: allow comparing objects with getters

setters/getters are marked as variables with special run_time_type.
object_equal_p() did not handle that case and ended up calling
low_is_equal with type PIKE_T_GET_SET which would lead to a
fatal.

This change makes object_equal_p() ignore getters.

4085:    return Y(5)->x;   ]], 7)    + test_any([[ +  // Triggered fatal since object_equal_p did not handle +  // getter/setter identifier correctly +  class A { +  string `foo() { return "bar"; } +  } +  +  return equal(A(), A()); + ]], 1) +    test_eval_error([[    // Triggered infinite recursion and core dump.    // cf LysLysKOM 18719518/Pike mailinglist 12047.