diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-05 23:24:13 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-05 23:24:13 +0000 |
commit | 1c7370f933e4f413d8cc8964ff946d4261da2e78 (patch) | |
tree | 2208e0083a6eb2e2012ca28766a4126e5970d798 /lib/Checker/StreamChecker.cpp | |
parent | b6a4026de13909c2b145166ae0b7d96cf1948f64 (diff) |
Don't assert on a file stream if its state is not tracked. Fix pr7831.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/StreamChecker.cpp')
-rw-r--r-- | lib/Checker/StreamChecker.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Checker/StreamChecker.cpp b/lib/Checker/StreamChecker.cpp index 37129be245..b18ab2908c 100644 --- a/lib/Checker/StreamChecker.cpp +++ b/lib/Checker/StreamChecker.cpp @@ -373,7 +373,10 @@ const GRState *StreamChecker::CheckDoubleClose(const CallExpr *CE, assert(Sym); const StreamState *SS = state->get<StreamState>(Sym); - assert(SS); + + // If the file stream is not tracked, return. + if (!SS) + return state; // Check: Double close a File Descriptor could cause undefined behaviour. // Conforming to man-pages |