summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-02-18 15:59:24 +0000
committerDouglas Gregor <dgregor@apple.com>2013-02-18 15:59:24 +0000
commit1c15cd6aaa5d1aa4d0d9226381be71eb9746787e (patch)
treed2b532cc9425d7c942d22a1ad6d7c65128f1ea85 /clang/lib/CodeGen
parent6168bd2323cdf2ff1dc4174c6fc4cd6a479f001b (diff)
downloadbcm5719-llvm-1c15cd6aaa5d1aa4d0d9226381be71eb9746787e.tar.gz
bcm5719-llvm-1c15cd6aaa5d1aa4d0d9226381be71eb9746787e.zip
CodeGenFunction::CurFuncDecl can be NULL; fix crash introduced in r175386.
llvm-svn: 175448
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index bf02439ec6c..b6617a0557b 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -1445,9 +1445,9 @@ private:
// base of the ivar access is a parameter to an Objective C method.
// However, because the parameters are not available in the current
// interface, we cannot perform this check.
- if (dyn_cast<ObjCMethodDecl>(CGF.CurFuncDecl))
- if (IV->getContainingInterface()->isSuperClassOf(ID))
- return true;
+ if (CGF.CurFuncDecl && isa<ObjCMethodDecl>(CGF.CurFuncDecl))
+ if (IV->getContainingInterface()->isSuperClassOf(ID))
+ return true;
return false;
}
OpenPOWER on IntegriCloud