Fix compound assignment#2087
Open
tgrant-nv wants to merge 3 commits intoAcademySoftwareFoundation:mainfrom
Open
Fix compound assignment#2087tgrant-nv wants to merge 3 commits intoAcademySoftwareFoundation:mainfrom
tgrant-nv wants to merge 3 commits intoAcademySoftwareFoundation:mainfrom
Conversation
… exactly once. This fix was aided by claude-4.6-opus.
Contributor
Author
|
Luca and I will look into these CI failures and update the PR ASAP. This is not a failure we saw in our testing, but I also did not enable batching. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change removes the de-sugaring of
a += b;intoa = a + b;that was happening very early during the AST construction, and instead makes the generation of OSO IR make sure theaside is evaluated only once.This is because the old behavior wouldn't handle correctly uses like
a[i++] += b[j++];(which is the array form ofa += b;in a way). Because the old behavior would evaluate theaside twice, it would incrementitwice, summing the elements ofbto the even elements ofa, and possibly accessing outside of the bounds ofa.Tests
Checklist:
already run clang-format v17 before submitting, I definitely will look at
the CI test that runs clang-format and fix anything that it highlights as
being nonconforming.