mirror of
https://github.com/intel/llvm.git
synced 2026-01-23 16:06:39 +08:00
[analyzer] More reliably detect property accessors.
This has a side effect of preventing a crash, which occurs because we get a property getter declaration, which is overriding but is declared inside @protocol. Will file a bug about this inconsistency internally. Getting a small test case is very challenging. llvm-svn: 190836
This commit is contained in:
@@ -685,8 +685,14 @@ const PseudoObjectExpr *ObjCMethodCall::getContainingPseudoObjectExpr() const {
|
||||
|
||||
ObjCMessageKind ObjCMethodCall::getMessageKind() const {
|
||||
if (Data == 0) {
|
||||
|
||||
// Find the parent, ignoring implicit casts.
|
||||
ParentMap &PM = getLocationContext()->getParentMap();
|
||||
const Stmt *S = PM.getParent(getOriginExpr());
|
||||
while (isa<ImplicitCastExpr>(S))
|
||||
S = PM.getParent(S);
|
||||
|
||||
// Check if parent is a PseudoObjectExpr.
|
||||
if (const PseudoObjectExpr *POE = dyn_cast_or_null<PseudoObjectExpr>(S)) {
|
||||
const Expr *Syntactic = POE->getSyntacticForm();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user