[PATCH] D126560: [analyzer] Track assume call stack to detect fixpoint

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 01:48:15 PDT 2022


steakhal added a comment.

New assertion failure:

  llvm-project/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:72: bool isLeftShiftResultUnrepresentable(const clang::BinaryOperator *, clang::ento::CheckerContext &): Assertion `LHS && RHS && "Values unknown, inconsistent state"' failed.

Reproduction:

  cat > extent.c <<EOF
  void crashing(long a, _Bool b) {
    a & 1 && 0;
    b = a & 1;
    b << 1;
  }
  EOF
  build/release/bin/clang --analyze -Xclang -analyzer-checker=core extent.c

The important part of the stack trace:

  isLeftShiftResultUnrepresentable(clang::BinaryOperator const*, clang::ento::CheckerContext&) llvm-project/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:73:20
  UndefResultChecker::checkPostStmt(clang::BinaryOperator const*, clang::ento::CheckerContext&) const llvm-project/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp:154:18

Please @martong have a look at this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126560/new/

https://reviews.llvm.org/D126560



More information about the cfe-commits mailing list