diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-02-11 19:30:33 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-02-11 19:30:33 +0000 |
commit | a09cd8103a6a719cb2628cdf0c91682250a17bd2 (patch) | |
tree | 29c4ce0b6826abe1aec4977f36c96b25225db508 /lib/Rewrite/Frontend/RewriteModernObjC.cpp | |
parent | f4e955b694be22926f5ceb41e55d319ce9ff4aab (diff) |
objective-C modern translator: Fixes a mistranslation
of @throw statement by finding location of the ';'
correctly. // rdar://13186010
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/Frontend/RewriteModernObjC.cpp')
-rw-r--r-- | lib/Rewrite/Frontend/RewriteModernObjC.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/lib/Rewrite/Frontend/RewriteModernObjC.cpp index 34ffd22723..f688603411 100644 --- a/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -2093,7 +2093,9 @@ Stmt *RewriteModernObjC::RewriteObjCThrowStmt(ObjCAtThrowStmt *S) { assert((*wBuf == 'w') && "@throw: can't find 'w'"); ReplaceText(startLoc, wBuf-startBuf+1, buf); - const char *semiBuf = strchr(startBuf, ';'); + SourceLocation endLoc = S->getLocEnd(); + const char *endBuf = SM->getCharacterData(endLoc); + const char *semiBuf = strchr(endBuf, ';'); assert((*semiBuf == ';') && "@throw: can't find ';'"); SourceLocation semiLoc = startLoc.getLocWithOffset(semiBuf-startBuf); if (S->getThrowExpr()) |