Assert when loading from a code text region instead of returning an unknown silently.
llvm-svn: 97436
diff --git a/clang/lib/Checker/RegionStore.cpp b/clang/lib/Checker/RegionStore.cpp
index f70105a..94decd3 100644
--- a/clang/lib/Checker/RegionStore.cpp
+++ b/clang/lib/Checker/RegionStore.cpp
@@ -975,8 +975,10 @@
if (isa<AllocaRegion>(MR) || isa<SymbolicRegion>(MR))
MR = GetElementZeroRegion(MR, T);
- if (isa<CodeTextRegion>(MR))
+ if (isa<CodeTextRegion>(MR)) {
+ assert(0 && "Why load from a code text region?");
return 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.