Closed bdunderscore closed 2 years ago
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅
I have read the CLA Document and I hereby sign the CLA
The issue with COWs getting dirtied conditionally is fixed for the moment by dirtying all COW values before entering flow control: https://github.com/vrchat-community/UdonSharp/blob/75bbcc8179ac5592fcbb0316f25c0055534b1bd0/Assets/UdonSharp/Editor/Compiler/Binder/BoundNodes/BoundConditionalExpression.cs#L38 the fix may be revisited at some point to have more fine-grained ValueTable scopes, but will need to allow inline declarations.
Certain ternary expressions could result in COWing the internal
this
constant unnecessarily. Markthis
as constant to avoid this.Because this hides another bug, I've added a (currently failing) test that detects the more general case of inappropriate COWing across ternary operators. I've not added it to the scene because I'm sure the merge will be a nightmare (and it's failing until some of Merlin's working branch changes land)
This is a resubmission of https://github.com/MerlinVR/UdonSharp/pull/132 against the newer branch and new repo.