Issue |
134954
|
Summary |
SemaObjC::HandleExprPropertyRefExpr assumes getInterfaceType() will never return nullptr
|
Labels |
new issue
|
Assignees |
shafik
|
Reporter |
shafik
|
Static analysis has flagged, this line in `SemaObjC::HandleExprPropertyRefExpr`:
https://github.com/llvm/llvm-project/blob/ab95005a05232030a16c2da7a8de867c2ded5f88/clang/lib/Sema/SemaExprObjC.cpp#L1982-L1983
as possibly returning `nullptr` which would make the subsequent access of `IFaceT->getDecl();` UB.
Based on the documentation:
https://github.com/llvm/llvm-project/blob/ab95005a05232030a16c2da7a8de867c2ded5f88/clang/lib/Sema/SemaExprObjC.cpp#L1975-L1976
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`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs