diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2007-12-06 01:37:55 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2007-12-06 01:37:55 +0000 |
commit | c002726237cc13f9c1f97f1d672eebc55f02080c (patch) | |
tree | 363ee6c3146c58e08ac81e6003b131dd03fd96a7 | |
parent | 8904f15ed9c49392232de80d55af3e4ceb88f854 (diff) |
A missing method in a messaging expression issues a warning, clients must not
crash because of this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44648 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Sema/SemaExpr.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index ed71934621..95b900c677 100644 --- a/Sema/SemaExpr.cpp +++ b/Sema/SemaExpr.cpp @@ -2242,6 +2242,10 @@ Sema::ExprResult Sema::ActOnInstanceMessage( Diag(lbrac, diag::warn_method_not_found, std::string("-"), Sel.getName(), SourceRange(lbrac, rbrac)); returnType = Context.getObjcIdType(); + // Must have a dummy method declaration, so clients work as expected + Method = new ObjcMethodDecl(SourceLocation(), SourceLocation(), Sel, + returnType, ClassDecl, 0, -1, 0, true, false, + ObjcMethodDecl::None); } else { returnType = Method->getResultType(); if (Sel.getNumArgs()) |