summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-09-01 23:00:46 +0000
committerTed Kremenek <kremenek@apple.com>2010-09-01 23:00:46 +0000
commitd588e78b95f426f6a1141a08a7eaebca6c79499d (patch)
treeeeb196aac8cfa5cad71b2c32f1edaeff585c78e0 /clang/lib/Checker/RegionStore.cpp
parent04c25c15c7bc4b22237534873d1a646a21fe6eb3 (diff)
downloadbcm5719-llvm-d588e78b95f426f6a1141a08a7eaebca6c79499d.tar.gz
bcm5719-llvm-d588e78b95f426f6a1141a08a7eaebca6c79499d.zip
Don't assert in the analyzer when analyze code does a byte load from a function's address. Fixes PR 8052.
llvm-svn: 112761
Diffstat (limited to 'clang/lib/Checker/RegionStore.cpp')
-rw-r--r--clang/lib/Checker/RegionStore.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Checker/RegionStore.cpp b/clang/lib/Checker/RegionStore.cpp
index 595fb6f19b0..19945a7b3c8 100644
--- a/clang/lib/Checker/RegionStore.cpp
+++ b/clang/lib/Checker/RegionStore.cpp
@@ -1087,6 +1087,10 @@ SVal RegionStoreManager::RetrieveElement(Store store,
return ValMgr.makeIntVal(c, T);
}
}
+
+ // Check for loads from a code text region. For such loads, just give up.
+ if (const CodeTextRegion *cR = dyn_cast<CodeTextRegion>(superR))
+ return UnknownVal();
// Handle the case where we are indexing into a larger scalar object.
// For example, this handles:
OpenPOWER on IntegriCloud