diff options
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; |