]> granicus.if.org Git - clang/commit
Disallow the use of UnknownVal as the index for ElementRegions. UnknownVals can...
authorTed Kremenek <kremenek@apple.com>
Wed, 15 Sep 2010 03:13:30 +0000 (03:13 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 15 Sep 2010 03:13:30 +0000 (03:13 +0000)
commit02282acd7a42d06a3178e3102d34a585bd82dd9f
treea28e6b6dd4619517dcf04cf3b8319219db6e5561
parent226cbfcd97e400ac1c1afc06d646424136cfe196
Disallow the use of UnknownVal as the index for ElementRegions.  UnknownVals can be used as
the index when the value evaluation isn't powerful enough.  By creating ElementRegions with
UnknownVals as the index, this gives the false impression that they are the same element, when
they really aren't.  This becomes really problematic when deriving symbols from these regions
(e.g., those representing the initial value of the index), since two different indices will
get the same symbol for their binding.

This fixes an issue with the idempotent operations checker that would cause two indices that
are clearly not the same to make it appear as if they always had the same value.

Fixes <rdar://problem/8431728>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113920 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Checker/PathSensitive/GRState.h
include/clang/Checker/PathSensitive/MemRegion.h
include/clang/Checker/PathSensitive/Store.h
lib/Checker/MemRegion.cpp
lib/Checker/RegionStore.cpp
lib/Checker/SVals.cpp
lib/Checker/Store.cpp
test/Analysis/idempotent-operations.c