aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2012-10-10 22:49:05 +0000
committerEric Christopher <echristo@gmail.com>2012-10-10 22:49:05 +0000
commit8ceb837585ed973dc36fba8dfc57ef60fc8f2735 (patch)
tree0d4b8b0730824c405b7fbdbfcdd0f366280be75a /lib
parentbc0a925caac5e1a8201af4e8500da0bc4bd4d955 (diff)
Temporarily Revert "[analyzer] Treat fields of unions as having symbolic offsets."
Author: Jordan Rose <jordan_rose@apple.com> Date: Wed Oct 10 21:31:21 2012 +0000 [analyzer] Treat fields of unions as having symbolic offsets. This allows only one field to be active at a time in RegionStore. This isn't quite the correct behavior for unions, but it at least would handle the case of "value goes in, value comes out" from the same field. RegionStore currently has a number of places where any access to a union results in UnknownVal being returned. However, it is clearly missing some cases, or the original issue wouldn't have occurred. It is probably now safe to remove those changes, but that's a potentially destabilizing change that should wait for more thorough testing. Fixes PR14054. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165660 91177308-0d34-0410-b5e6-96231b3b80d8 This reverts commit cf9030e480f77ab349672f00ad302e216c26c92c. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/StaticAnalyzer/Core/MemRegion.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Core/MemRegion.cpp b/lib/StaticAnalyzer/Core/MemRegion.cpp
index da34a79968..7c66739558 100644
--- a/lib/StaticAnalyzer/Core/MemRegion.cpp
+++ b/lib/StaticAnalyzer/Core/MemRegion.cpp
@@ -1168,12 +1168,8 @@ RegionOffset MemRegion::getAsOffset() const {
R = FR->getSuperRegion();
const RecordDecl *RD = FR->getDecl()->getParent();
- if (/*RD->isUnion() || */!RD->isCompleteDefinition()) {
+ if (!RD->isCompleteDefinition()) {
// We cannot compute offset for incomplete type.
- // For unions, we could treat everything as offset 0, but we'd rather
- // treat each field as a symbolic offset so they aren't stored on top
- // of each other, since we depend on things in typed regions actually
- // matching their types.
SymbolicOffsetBase = R;
}