-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lint and fix bugprone-use-after-move
violations
#35978
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, LGTM. I thought we had this on already. I remember fixing the issue when I first implemented the linter. My only concern was its inability to figure out the ternary operator case. I don't want to accept worse performance to make the linter happy.
? Push<DrawSkPictureMatrixOp>(0, 1, std::move(picture), *matrix, | ||
? Push<DrawSkPictureMatrixOp>(0, 1, picture, *matrix, | ||
render_with_attributes) | ||
: Push<DrawSkPictureOp>(0, 1, std::move(picture), render_with_attributes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a false alarm. Only one move is guaranteed to execute and this technically changes the performance for the worse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem isn't the ternary, it's that we reference picture on the line right under this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh missed that, nice catch. LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Well, the line under the comments under this, which GitHub is cutting off by default :)
lazy_glyph_atlas->AddTextFrame(std::move(text_frame)); | ||
lazy_glyph_atlas->AddTextFrame(text_frame); | ||
|
||
auto text_contents = std::make_shared<TextContents>(); | ||
text_contents->SetTextFrame(std::move(text_frame)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this not a bug? This manifests as a bug right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chinmaygarde may know. I don't understand how this ever worked :)
There's some lint in there that is checking for calling methods on |
bugprone-use-after-move violations
bugprone-use-after-move
violations
auto label is removed for flutter/engine, pr: 35978, due to - The status or check suite Mac clang-tidy has failed. Please fix the issues identified (or deflake) before re-applying this label. |
auto label is removed for flutter/engine, pr: 35978, due to - The status or check suite Linux clang-tidy has failed. Please fix the issues identified (or deflake) before re-applying this label. |
There have been a few violations introduced by new commits as I'm writing this PR. If it happens to fail in post submit we should fix forward rather than reverting. The main culprit seems to be people copy/pasting something like |
auto label is removed for flutter/engine, pr: 35978, due to - The status or check suite Mac iOS Engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
From PR triage: This is blocked on the tree closure @ flutter/flutter#111193. |
)" This reverts commit 6279c78.
Fixes flutter/flutter#111135
Adds some ignores for tests that explicitly want to test behavior of use after move.