[analyzer] Start fixing modeling of bool based types
This is a follow up for one of the previous diffs https://reviews.llvm.org/D32328. getTypeSize and with getIntWidth are not equivalent for bool (see https://clang.llvm.org/doxygen/ASTContext_8cpp_source.html#l08444), this causes a number of issues (for instance, if APint X representing a bool is created with the wrong bit width then X is not comparable against Min/Max (because of the different bit width), that results in crashes (triggered asserts) inside assume* methods), for examples see the newly added test cases. Test plan: make check-all Differential revision: https://reviews.llvm.org/D35041 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307604 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h 1 addition, 1 deletion...ang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h
- lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp 2 additions, 5 deletionslib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
- test/Analysis/enum.cpp 30 additions, 0 deletionstest/Analysis/enum.cpp
Loading
Please register or sign in to comment