diff options
| author | Ted Kremenek <kremenek@apple.com> | 2007-09-11 17:00:40 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2007-09-11 17:00:40 +0000 |
| commit | ca6c2b750b738753a7f46cde26e9448217abe8fc (patch) | |
| tree | 4b9fc35bb0329ace27ca4e41e8f8e4df87698e20 | |
| parent | 412af03cee1e45b14b85d46914bf3103067f31d5 (diff) | |
| download | bcm5719-llvm-ca6c2b750b738753a7f46cde26e9448217abe8fc.tar.gz bcm5719-llvm-ca6c2b750b738753a7f46cde26e9448217abe8fc.zip | |
Fixed potential NULL dereference when iterating over a chain of Decls.
llvm-svn: 41848
| -rw-r--r-- | clang/Analysis/DeadStores.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/Analysis/DeadStores.cpp b/clang/Analysis/DeadStores.cpp index a9a42a8e18f..e547989f6b8 100644 --- a/clang/Analysis/DeadStores.cpp +++ b/clang/Analysis/DeadStores.cpp @@ -50,7 +50,7 @@ public: // Iterate through the decls. Warn if any of them (which have // initializers) are not live. for (VarDecl* V = cast<VarDecl>(DS->getDecl()); V != NULL ; - V = cast<VarDecl>(V->getNextDeclarator())) + V = cast_or_null<VarDecl>(V->getNextDeclarator())) if (Expr* E = V->getInit()) if (!L.isLive(Live,V)) { SourceRange R = E->getSourceRange(); |

