From 0bb32e3e5d7524022642a8055da3ffe32ea5952a Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 3 Aug 2009 21:41:46 +0000 Subject: Handle disgusting corner case where a byte is loaded from the address of a function. llvm-svn: 78000 --- clang/lib/Analysis/RegionStore.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Analysis') diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 543783d924f..c47aaa20e07 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/lib/Analysis/RegionStore.cpp @@ -882,6 +882,9 @@ RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) { MR = MRMgr.getElementRegion(T, idx, MR, Ctx); } + if (isa(MR)) + return SValuator::CastResult(state, UnknownVal()); + // FIXME: Perhaps this method should just take a 'const MemRegion*' argument // instead of 'Loc', and have the other Loc cases handled at a higher level. const TypedRegion *R = cast(MR); @@ -1000,7 +1003,6 @@ SVal RegionStoreManager::RetrieveElement(const GRState* state, if (R->getIndex().isZeroConstant()) { if (const TypedRegion *superTR = dyn_cast(superR)) { ASTContext &Ctx = getContext(); - if (IsAnyPointerOrIntptr(superTR->getValueType(Ctx), Ctx)) { QualType valTy = R->getValueType(Ctx); if (IsAnyPointerOrIntptr(valTy, Ctx)) { -- cgit v1.2.3