From 2db08ca1246648bb7e8f32551b2d8483fb889bf8 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Mon, 1 Mar 2010 05:29:02 +0000 Subject: [PATCH] Assert when loading from a code text region instead of returning an unknown silently. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97436 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Checker/RegionStore.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Checker/RegionStore.cpp b/lib/Checker/RegionStore.cpp index f70105af13..94decd3d99 100644 --- a/lib/Checker/RegionStore.cpp +++ b/lib/Checker/RegionStore.cpp @@ -975,8 +975,10 @@ SVal RegionStoreManager::Retrieve(Store store, Loc L, QualType T) { if (isa(MR) || isa(MR)) MR = GetElementZeroRegion(MR, T); - if (isa(MR)) + if (isa(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. -- 2.50.1