-
Notifications
You must be signed in to change notification settings - Fork 13.5k
SemaObjC::HandleExprPropertyRefExpr assumes getInterfaceType() will never return nullptr #134954
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
Comments
CC @rjmccall does this look like the right path? |
@llvm/issue-subscribers-clang-frontend Author: Shafik Yaghmour (shafik)
Static analysis has flagged, this line in `SemaObjC::HandleExprPropertyRefExpr`:
llvm-project/clang/lib/Sema/SemaExprObjC.cpp Lines 1982 to 1983 in ab95005
as possibly returning Based on the documentation: llvm-project/clang/lib/Sema/SemaExprObjC.cpp Lines 1975 to 1976 in ab95005
and the rest of the code it seems clear that the assumption is that it will always be valid. We could document more clearly w/ an assertion on |
ping @rjmccall |
Static analysis flagged that we use IFaceT in HandleExprPropertyRefExpr without checking even though getInterfaceType() can return nullptr. The comments make it clear the assumption is that we will always have an interface, so we will document this via an assert. Fixes: llvm#134954
…vm#138026) Static analysis flagged that we use IFaceT in HandleExprPropertyRefExpr without checking even though getInterfaceType() can return nullptr. The comments make it clear the assumption is that we will always have an interface, so we will document this via an assert. Fixes: llvm#134954
…vm#138026) Static analysis flagged that we use IFaceT in HandleExprPropertyRefExpr without checking even though getInterfaceType() can return nullptr. The comments make it clear the assumption is that we will always have an interface, so we will document this via an assert. Fixes: llvm#134954
…vm#138026) Static analysis flagged that we use IFaceT in HandleExprPropertyRefExpr without checking even though getInterfaceType() can return nullptr. The comments make it clear the assumption is that we will always have an interface, so we will document this via an assert. Fixes: llvm#134954
…RefExpr (#138026) Static analysis flagged that we use IFaceT in HandleExprPropertyRefExpr without checking even though getInterfaceType() can return nullptr. The comments make it clear the assumption is that we will always have an interface, so we will document this via an assert. Fixes: llvm/llvm-project#134954
…vm#138026) Static analysis flagged that we use IFaceT in HandleExprPropertyRefExpr without checking even though getInterfaceType() can return nullptr. The comments make it clear the assumption is that we will always have an interface, so we will document this via an assert. Fixes: llvm#134954
Static analysis has flagged, this line in
SemaObjC::HandleExprPropertyRefExpr
:llvm-project/clang/lib/Sema/SemaExprObjC.cpp
Lines 1982 to 1983 in ab95005
as possibly returning
nullptr
which would make the subsequent access ofIFaceT->getDecl();
UB.Based on the documentation:
llvm-project/clang/lib/Sema/SemaExprObjC.cpp
Lines 1975 to 1976 in ab95005
and the rest of the code it seems clear that the assumption is that it will always be valid.
We could document more clearly w/ an assertion on
IFaceT
.The text was updated successfully, but these errors were encountered: