Branch: Tag:

2015-03-23

2015-03-23 20:05:18 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Runtime: Fixed over optimization in F_APPEND_ARRAY.

Setters expect to be called when the corresponding variable is modified...

This behaviour caused Roxen's test-suite to fail due to change triggers
not being called.

4113:   ]], 1)      test_any([[ +  // Since the addition of F_APPEND_ARRAY the setter is not being +  // called anymore. Instead, the array _data is modified in place. +  class A(array _data) { +  int counter; +  +  void `foo=(mixed v) { +  counter += !!v; +  _data = v; +  } +  +  mixed `foo() { +  return _data; +  } +  }; +  +  object a = A(({})); +  +  for (int i = 0; i < 6; i++) { +  a->foo += ({ i }); +  } +  +  return a->counter; + ]], 6) +  + test_any([[ +  // Since the addition of F_APPEND_ARRAY the setter is not being +  // called anymore. Instead, the array _data is modified in place. +  class A(array foo) { +  int counter; +  +  mixed `->=(string sym, mixed v) { +  counter += !!v; +  return ::`->=(sym, v); +  } +  }; +  +  object a = A(({})); +  +  for (int i = 0; i < 6; i++) { +  a->foo += ({ i }); +  } +  +  return a->counter; + ]], 6) +  + test_any([[    // Triggered fatal since object_equal_p did not handle    // getter/setter identifier correctly    class A {