Skip to content

Everywhere: Bunch of random fixes #25997

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Hendiadyoin1
Copy link
Contributor

Some found by trowing the clang static analyzer against the code,
The Error one is just my back log (thanks andrew)
The LibElf ones are just random.

Plus some drive-by changes, like removing redundant `Detail::` prefixes
and being more studious about forwarding.
This makes my IDE happy when viewing that file
We can't really move from the NNRP as we also need to reference it in
the same statement, so we pass it as a reference instead, as we
are now using it only as such.
…Plan9FSMessage

This is an ugly workaround, but more correct than the previous version.
@Hendiadyoin1 Hendiadyoin1 requested a review from BertalanD as a code owner June 14, 2025 21:27
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Jun 14, 2025
@@ -55,7 +55,6 @@ class CircularQueue {
VERIFY(!is_empty());
auto& slot = elements()[m_head];
T value = move(slot);
slot.~T();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is incorrect; the destructors of moved-from objects are run regardless according to C++ semantics (e.g. in the case of variables on the stack).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well clang-sa pointed this one out, but I see your point
not sure if I should mark this somehow (launder?), but I will drop this commit for now

construct_at<E>(&m_error, other.release_error());
construct_at<E>(&m_error, forward<ErrorOr>(other).release_error());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think other is a forwarding reference here, as we're not in a template method. Does forward even do anything here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this case it's a move?
But can make it an explicit move in case it is really needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 pr-needs-review PR needs review from a maintainer or community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants