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

this == nullptr results in undefined behavior #6978

Open
2 of 4 tasks
ShortDevelopment opened this issue Apr 17, 2024 · 3 comments
Open
2 of 4 tasks

this == nullptr results in undefined behavior #6978

ShortDevelopment opened this issue Apr 17, 2024 · 3 comments

Comments

@ShortDevelopment
Copy link
Contributor

ShortDevelopment commented Apr 17, 2024

Issue

‘this’ pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true

Tasks

@ppenzin
Copy link
Member

ppenzin commented Apr 17, 2024

This warning should now be enabled in Clang by default, though didn't catch this earlier due to -Werror, I suspect it wasn't enabled in the version from the package manager.

@ShortDevelopment
Copy link
Contributor Author

if (this == NULL)

@rhuanjl
Copy link
Collaborator

rhuanjl commented Apr 19, 2024

I had a look IR.cpp and the invalid check is being done part of a Debug only feature; so it's not as critical a concern as ImmutableList.

I've also done a sequence of searches in the codebase and I don't think there's anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants