From d588e78b95f426f6a1141a08a7eaebca6c79499d Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 1 Sep 2010 23:00:46 +0000 Subject: Don't assert in the analyzer when analyze code does a byte load from a function's address. Fixes PR 8052. llvm-svn: 112761 --- clang/lib/Checker/Store.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'clang/lib/Checker/Store.cpp') diff --git a/clang/lib/Checker/Store.cpp b/clang/lib/Checker/Store.cpp index 7c80eed0ead..1cb5cd70cae 100644 --- a/clang/lib/Checker/Store.cpp +++ b/clang/lib/Checker/Store.cpp @@ -101,17 +101,10 @@ const MemRegion *StoreManager::CastRegion(const MemRegion *R, QualType CastToTy) assert(0 && "Invalid region cast"); break; } - + case MemRegion::FunctionTextRegionKind: case MemRegion::BlockTextRegionKind: - case MemRegion::BlockDataRegionKind: { - // CodeTextRegion should be cast to only a function or block pointer type, - // although they can in practice be casted to anything, e.g, void*, char*, - // etc. - // Just return the region. - return R; - } - + case MemRegion::BlockDataRegionKind: case MemRegion::StringRegionKind: // FIXME: Need to handle arbitrary downcasts. case MemRegion::SymbolicRegionKind: -- cgit v1.2.3