mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
The syntactic node assiociated with accessor calls was previously always the underlying member access. For example, in ``` x.Prop = y.Prop; ``` the implicit call to `x.set_Prop()` was at the syntactic node `x.Prop`, while the implicit call to `y.get_Prop()` was at the syntactic node `y.Prop`. However, this breaks the invariant that arguments to calls dominate the call itself, as the argument `y.Prop` for the implicit `value` parameter in `x.set_Prop()` will be evaluated after the call (the left-hand side in an assignment is evaluated before the right-hand side). The solution is to redefine the access call to `x.set_Prop()` to point to the whole assignment `x.Prop = y.Prop`, instead of the access `x.Prop`. For reads, we still want to associate the accessor call with the member access. A corner case arises when multiple setters are called in a tuple assignment: ``` (x.Prop1, x.Prop2) = (0, 1) ``` In this case, we cannot associate the assignment with both `x.set_Prop1()` and `x.set_Prop2()`, so we instead revert to using the underlying member accesses as before.