Skip to content

Ensure a side vector's `object` and `VECTORSIDE` are consistent

A side vector belongs to one or two elements. One of them is stored as a representative in the vector's object member and the side of the object it belongs to is stored in VECTORSIDE as part of the control word.

When restoring consistency in ElementObjMkCons this reverse link from the side vector to the element is restored, but the VECTORSIDE was not. This can lead to an inconsistent view for side vectors belonging to two elements:

On the master, let the vector v's representative element be A and the side of the element be a. Let B (b) be the other representative and assume a ≠ b. As the vector's control word is global data (EL_GDATA), the non-master side vectors will also have VECTORSIDE set to a.

If now ElementObjMkCons is called first for A and then for B, then v.object will first be set to A, but then B. However VECTORSIDE is still a!

This change makes sure that VECTORSIDE is also updated alongside the object pointer. Note that it is (still) not guaranteed that the same representative is chosen.

Closes #12 (closed)

Merge request reports