]> granicus.if.org Git - clang/commitdiff
Assert when loading from a code text region instead of returning an unknown silently.
authorZhongxing Xu <xuzhongxing@gmail.com>
Mon, 1 Mar 2010 05:29:02 +0000 (05:29 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Mon, 1 Mar 2010 05:29:02 +0000 (05:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97436 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/RegionStore.cpp

index f70105af137997223a50eedc1ad26368ab8ca5c4..94decd3d99c0683bba40811aeaba54bfba908736 100644 (file)
@@ -975,8 +975,10 @@ SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) {
   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.