llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[Analyzer] Assertion "System is over constrained" after truncating 64 bits integers to 32 bits.

Open goussepi opened this issue 11 years ago • 4 comments

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.

goussepi avatar Oct 06 '15 19:10 goussepi

Thanks Denys for checking, yes closing as fixed now!

goussepi avatar Jun 09 '20 16:06 goussepi

pierre gousseau, I think you should come to a decision for this bug, since your patch has been loaded.

ghost avatar Jun 09 '20 11:06 ghost

I have a proposed a fix for this at http://reviews.llvm.org/D12901

goussepi avatar Oct 06 '15 19:10 goussepi

assigned to @tkremenek

goussepi avatar Oct 06 '15 19:10 goussepi