]> granicus.if.org Git - clang/commit
[Analyzer] Constraint Manager Negates Difference
authorAdam Balogh <adam.balogh@ericsson.com>
Thu, 28 Jun 2018 07:35:23 +0000 (07:35 +0000)
committerAdam Balogh <adam.balogh@ericsson.com>
Thu, 28 Jun 2018 07:35:23 +0000 (07:35 +0000)
commite3ba09890ac9769c514f419f80566ee612103b89
treeaf6aa6cdfec8d32e27ee17757324e2ea9bac84cc
parent03d5d6e5e34fb3fe966479393d4cebad2e339e7b
[Analyzer] Constraint Manager Negates Difference

If range [m .. n] is stored for symbolic expression A - B, then we can deduce the range for B - A which is [-n .. -m]. This is only true for signed types, unless the range is [0 .. 0].

Differential Revision: https://reviews.llvm.org/D35110

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335814 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/PathSensitive/RangedConstraintManager.h
lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
test/Analysis/constraint_manager_negate_difference.c [new file with mode: 0644]
test/Analysis/ptr-arith.c