[Analyzer] Assertion "System is over constrained" after truncating 64 bits integers to 32 bits.
| Bugzilla Link | 25078 |
| Resolution | FIXED |
| Resolved on | Jun 09, 2020 09:14 |
| Version | trunk |
| OS | Linux |
| Attachments | test case |
| CC | @ASDenysPetrov |
Extended Description
clang version: trunk @248379
Given the following test case:
void f1(long foo) { unsigned index = -1; if (index < foo) index = foo; if (index + 1 == 0) // -> "system over constrained" assertion clang_analyzer_warnIfReached(); // -> never reached but should be else clang_analyzer_warnIfReached(); }
A "System is over constrained" assertion is triggered with debug builds:
$ clang -cc1 -triple x86_64-pc-linux -analyze -analyzer-checker=core,debug.ExprInspection test.cpp clang: ../tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h:86: clang::ento::ConstraintManager::ProgramStatePair clang::ento::ConstraintManager::assumeDual(clang::ento::ProgramStateRef, clang::ento::DefinedSVal): Assertion `assume(State, Cond, false) && "System is over constrained."' failed.
Thanks Denys for checking, yes closing as fixed now!
pierre gousseau, I think you should come to a decision for this bug, since your patch has been loaded.
I have a proposed a fix for this at http://reviews.llvm.org/D12901
assigned to @tkremenek