diff options
author | Steve Naroff <snaroff@apple.com> | 2008-11-19 15:54:23 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-11-19 15:54:23 +0000 |
commit | 9e4ac111f04b581b9d85d51c2f7f68af86d6d4ba (patch) | |
tree | a2d8836e4c66cab11715b9c397c2d346e6144ae6 /clang/lib/Parse/ParseInit.cpp | |
parent | d08452f60a2731c279f3b845d84a4a8940844d99 (diff) | |
download | bcm5719-llvm-9e4ac111f04b581b9d85d51c2f7f68af86d6d4ba.tar.gz bcm5719-llvm-9e4ac111f04b581b9d85d51c2f7f68af86d6d4ba.zip |
Fix <rdar://problem/6150376> [sema] crash on invalid message send.
The core fix in Sema::ActOnClassMessage(). All the other changes have to do with passing down the SourceLocation for the receiver (to properly position the cursor when producing an error diagnostic).
llvm-svn: 59639
Diffstat (limited to 'clang/lib/Parse/ParseInit.cpp')
-rw-r--r-- | clang/lib/Parse/ParseInit.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseInit.cpp b/clang/lib/Parse/ParseInit.cpp index 9b488566a61..c3d2cd2c4cc 100644 --- a/clang/lib/Parse/ParseInit.cpp +++ b/clang/lib/Parse/ParseInit.cpp @@ -134,8 +134,9 @@ ParseInitializerWithPotentialDesignator(InitListDesignations &Designations, } IdentifierInfo *Name = Tok.getIdentifierInfo(); - ConsumeToken(); - return ParseAssignmentExprWithObjCMessageExprStart(StartLoc, Name, 0); + SourceLocation NameLoc = ConsumeToken(); + return ParseAssignmentExprWithObjCMessageExprStart(StartLoc, NameLoc, + Name, 0); } // Note that we parse this as an assignment expression, not a constant @@ -166,7 +167,9 @@ ParseInitializerWithPotentialDesignator(InitListDesignations &Designations, Diag(Tok, diag::err_expected_equal_designator); } - return ParseAssignmentExprWithObjCMessageExprStart(StartLoc, 0,Idx.Val); + return ParseAssignmentExprWithObjCMessageExprStart(StartLoc, + SourceLocation(), + 0, Idx.Val); } // Create designation if we haven't already. |