diff options
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h | 2 | ||||
-rw-r--r-- | test/Analysis/cxx-crashes.cpp | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h b/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h index 02517e38b4..a4327e127f 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h @@ -164,7 +164,7 @@ public: } inline const llvm::APSInt& getTruthValue(bool b) { - return getTruthValue(b, Ctx.IntTy); + return getTruthValue(b, Ctx.getLogicalOperationType()); } const CompoundValData *getCompoundValData(QualType T, diff --git a/test/Analysis/cxx-crashes.cpp b/test/Analysis/cxx-crashes.cpp new file mode 100644 index 0000000000..720850cc5c --- /dev/null +++ b/test/Analysis/cxx-crashes.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -verify %s + +int f1(char *dst) { + char *p = dst + 4; + char *q = dst + 3; + return !(q >= p); +} |