llvm-capstone/clang/test/Analysis/symbol-simplification-bo-div.c
Vince Bridgers 9ef7ac51af [analyzer] Fix crash in RangedConstraintManager.cpp
This change fixes a crash in RangedConstraintManager.cpp:assumeSym due to an
unhandled BO_Div case.

clang: <root>clang/lib/StaticAnalyzer/Core/RangedConstraintManager.cpp:51:
  virtual clang::ento::ProgramStateRef
  clang::ento::RangedConstraintManager::assumeSym(clang::ento::ProgramStateRef,
    clang::ento::SymbolRef, bool):
  Assertion `BinaryOperator::isComparisonOp(Op)' failed.

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D122277
2022-03-23 08:26:40 -05:00

15 lines
254 B
C

// RUN: %clang_analyze_cc1 -analyzer-checker=core %s \
// RUN: -triple x86_64-pc-linux-gnu -verify
// don't crash
// expected-no-diagnostics
int a, b;
int c(void) {
unsigned d = a;
--d;
short e = b / b - a;
++e;
return d <= 0 && e && e;
}