Skip to content

Fixes as suggested by clang-tidy.#193

Merged
tmbrbr merged 1 commit into
SAP:mainfrom
leeN:static-analysis-fixes
Jan 22, 2024
Merged

Fixes as suggested by clang-tidy.#193
tmbrbr merged 1 commit into
SAP:mainfrom
leeN:static-analysis-fixes

Conversation

@leeN

@leeN leeN commented Jan 18, 2024

Copy link
Copy Markdown
Collaborator
  • Cleaned up std::move usage

This includes removing invocations where it does not have any impact, e.g., moving ints or arrays. I also added std::move calls for types where it improves performance, such as strings or std::vector.

  • Added noexcept modifier to move constructors

  • Added parentheses where they were missing.

  • Added pointer qualifier to auto declarations

  • Added checks to prevent broken objects in case of self assignments

For example for TaintFlow the assignment constructor first releases its own resources. If a self assignment TaintFlow f = flow; takes place, this would mean we release the resources and then try to use them, which is obviously problematic.

  • Removed some superfluous copies by using references.

- Cleaned up std::move usage

This includes removing invocations where it does not have any impact,
e.g., moving ints or arrays. I also added std::move calls for types
where it improves performance, such as strings or std::vector.

- Added noexcept modifier to move constructors

- Added parentheses where they were missing.

- Added pointer qualifier to auto declarations

- Added checks to prevent broken objects in case of self
  assignments

For example for TaintFlow the assignment constructor first releases
its own resources. If a self assignment TaintFlow f = flow; takes
place, this would mean we release the resources and then try to use
them, which is obviously problematic.

- Removed some superfluous copies by using references.
@tmbrbr tmbrbr self-requested a review January 18, 2024 13:24
@tmbrbr tmbrbr merged commit e6d69a1 into SAP:main Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants