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 | 5cb93b8bf009c4b0ae09b71ba85f54b2a7ea8022 (patch) | |
tree | 94dac43df0a39c26d55980ad047066292ea716f8 /lib/Parse/ParseInit.cpp | |
parent | 74253736184c0717a0649922551bf9d8b6815651 (diff) |
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59639 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseInit.cpp')
-rw-r--r-- | lib/Parse/ParseInit.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Parse/ParseInit.cpp b/lib/Parse/ParseInit.cpp index 9b488566a6..c3d2cd2c4c 100644 --- a/lib/Parse/ParseInit.cpp +++ b/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. |