summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-08-21 18:56:50 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-08-21 18:56:50 +0000
commitf1f36c6a9ae13c4956617e1d866f507907e0838a (patch)
tree5774f137e3e7ee753b5801f0fecde65abb9ec301 /clang/lib/Rewrite
parent5bd4c2ace46501f475a6b59e1edfd94777b9362b (diff)
downloadbcm5719-llvm-f1f36c6a9ae13c4956617e1d866f507907e0838a.tar.gz
bcm5719-llvm-f1f36c6a9ae13c4956617e1d866f507907e0838a.zip
Modern objc translator: Fixes a crash in rewriter when rewriting the API
for structure valued method messaging. // rdar://12142241 llvm-svn: 162303
Diffstat (limited to 'clang/lib/Rewrite')
-rw-r--r--clang/lib/Rewrite/RewriteModernObjC.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Rewrite/RewriteModernObjC.cpp b/clang/lib/Rewrite/RewriteModernObjC.cpp
index dcd003f5016..9c98a7ff2ba 100644
--- a/clang/lib/Rewrite/RewriteModernObjC.cpp
+++ b/clang/lib/Rewrite/RewriteModernObjC.cpp
@@ -3140,7 +3140,14 @@ Expr *RewriteModernObjC::SynthMsgSendStretCallExpr(FunctionDecl *MsgSendStretFla
str += "\t"; str += returnType.getAsString(Context->getPrintingPolicy());
str += " s;\n";
str += "};\n\n";
- SourceLocation FunLocStart = getFunctionSourceLocation(*this, CurFunctionDef);
+ SourceLocation FunLocStart;
+ if (CurFunctionDef)
+ FunLocStart = getFunctionSourceLocation(*this, CurFunctionDef);
+ else {
+ assert(CurMethodDef && "SynthMsgSendStretCallExpr - CurMethodDef is null");
+ FunLocStart = CurMethodDef->getLocStart();
+ }
+
InsertText(FunLocStart, str);
++stretCount;
OpenPOWER on IntegriCloud