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

Fix false positive use after free warning. #7046

Merged
merged 1 commit into from
Sep 23, 2022

Conversation

zvookin
Copy link
Member

@zvookin zvookin commented Sep 23, 2022

Latest clang is giving a use after free warning for printing a pointer value after it is freed. The compiler is not exactly wrong in that a pointer is being passed to something after it is freed, but the something is just printing the pointer's value for debugging purposes. Cast through an intptr_t to avoid the warning.

Latest clang is giving a use after free warning for printing a pointer
value after it is freed. The compiler is not exactly wrong in that a
pointer is being passed to something after it is freed, but the
something is just printing the pointer's value for debugging
purposes. Cast through an intptr_t to avoid the warning.
Copy link
Contributor

@derek-gerstmann derek-gerstmann left a comment

Choose a reason for hiding this comment

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

Ahh, thanks for the heads up! Nice to see pointer usage tracking diagnostics in clang too!

@steven-johnson
Copy link
Contributor

We should probably file a bug on this; that's totally legit code and should not be flagged

@zvookin zvookin merged commit 6499ad1 into main Sep 23, 2022
@zvookin zvookin deleted the fix_false_use_after_free_warning branch September 23, 2022 22:58
ardier pushed a commit to ardier/Halide-mutation that referenced this pull request Mar 3, 2024
Latest clang is giving a use after free warning for printing a pointer
value after it is freed. The compiler is not exactly wrong in that a
pointer is being passed to something after it is freed, but the
something is just printing the pointer's value for debugging
purposes. Cast through an intptr_t to avoid the warning.
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.

3 participants