Skip to content
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

[WIP] Add naive first implementation of per-allocator disablement of ASan #5241

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

davidmrdavid
Copy link
Member

This is a WIP, opening for visibility and checkpointing only.

stl/inc/xmemory Outdated Show resolved Hide resolved
stl/inc/xmemory Outdated Show resolved Hide resolved
stl/inc/vector Outdated
@@ -493,6 +493,10 @@ private:
return;
}

if (!is_ASan_enabled_for_allocator_v<allocator_type>) {
Copy link
Member

Choose a reason for hiding this comment

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

Since this is testing a constant expression, it should probably be an if constexpr containing the entire function body so we don't bother to so much as compile it.

Copy link
Member Author

Choose a reason for hiding this comment

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

constexpr'ed all the things: 71c7716

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's better to write

if constexpr (is_ASan_enabled_for_allocator_v<allocator_type>) {
// ASan stuffs
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I thought about that as well. In this case we're inside the _Apply_annotation method which, to my understanding, is already ASan-specific. I figure we wouldn't want to indent all of the remaining code to be inside the if-statement.

Do let me know if I'm misunderstanding something though :-)

@StephanTLavavej StephanTLavavej added enhancement Something can be improved ASan Address Sanitizer labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASan Address Sanitizer enhancement Something can be improved
Projects
Status: Work In Progress
Development

Successfully merging this pull request may close these issues.

4 participants