diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-29 20:00:16 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-06-29 20:00:16 +0000 |
commit | 8fefc8e245c47daacae7a7fb218677fdcb85d122 (patch) | |
tree | 25de03136848160189e17d0681b89e5c416a5e59 /lib/CodeGen/CGDecl.cpp | |
parent | 5d9b6bf9de98a33427fc7a3beeca90a3002b4744 (diff) |
objc-arc: fix a IRGen crash when checking for
accessibility of an initializer which is a compound
statement. // rdar://9694706
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134091 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index 68b1d3be66..d508ff7390 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -454,7 +454,8 @@ static bool isAccessedBy(const VarDecl &var, const Stmt *s) { } for (Stmt::const_child_range children = s->children(); children; ++children) - if (isAccessedBy(var, *children)) + // children might be null; as in missing decl or conditional of an if-stmt. + if ((*children) && isAccessedBy(var, *children)) return true; return false; |