Open llvmbot opened 9 years ago
mentioned in issue llvm/llvm-bugzilla-archive#22205
The analyzer's not meant to run with any of the core checkers disabled. It really has no way to represent a state in which a division-by-zero has occurred and the program has /not/ crashed. The same applies to most of the other core checkers.
One thing that could be done here is a refactoring so that turning off the core checker only turns off the output, not the path pruning, but without further information I can't say whether that will actually solve your problem.
Bug llvm/llvm-bugzilla-archive#22205 has been marked as a duplicate of this bug.
assigned to @tkremenek
Extended Description
I found this problem using clang 3.4 and checker-276. I have just checked to see if the problem still occurs with a trunk build of llvm + clang and it does.
ex.cpp - contains a divide by zero error
int main() { int i = 0; return 1/i; }
As soon as you try and disable the relevant core checker the static analyzer asserts
$HOME/llvm-20150112/tools/clang/tools/scan-build/scan-build --use-analyzer=$HOEM/llvm-20150112-build/Release+Asserts/bin/clang --use-c++=$HOME/llvm-20150112-build/Release+Asserts/bin/clang -disable-checker core.DivideZero clang -g -o ex ex.cpp
clang: /vault/home/adrian.swain/llvm-20150112/lib/Support/APInt.cpp:1866: llvm::APInt llvm::APInt::udiv(const llvm::APInt&) const: Assertion `RHS.VAL != 0 && "Divide by zero?"' failed.