summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-02-11 19:30:33 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-02-11 19:30:33 +0000
commitb0fdab26d17293c6442bcf81573864212119dd5e (patch)
tree378aa13e78107bc562b913dea8ef9a8e92f16e8d /clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
parent6ad180cf355f98798c3d06457516f8474b3d5e2d (diff)
downloadbcm5719-llvm-b0fdab26d17293c6442bcf81573864212119dd5e.tar.gz
bcm5719-llvm-b0fdab26d17293c6442bcf81573864212119dd5e.zip
objective-C modern translator: Fixes a mistranslation
of @throw statement by finding location of the ';' correctly. // rdar://13186010 llvm-svn: 174898
Diffstat (limited to 'clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp')
-rw-r--r--clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
index 34ffd227237..f6886034114 100644
--- a/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp
+++ b/clang/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())
OpenPOWER on IntegriCloud