]> granicus.if.org Git - clang/commitdiff
Rewrite code fragment to avoide ICE in MSVC. Fixes PR 7875. Patch by Dimitry Andric!
authorTed Kremenek <kremenek@apple.com>
Tue, 17 Aug 2010 23:29:06 +0000 (23:29 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 17 Aug 2010 23:29:06 +0000 (23:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111327 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/RegionStore.cpp

index 9b8579cdeb26676a58ac7a937b043dba23db98d6..d6422ab338f9b028965c504cf48e52c8c4475341 100644 (file)
@@ -1538,8 +1538,10 @@ Store RegionStoreManager::BindStruct(Store store, const TypedRegion* R,
   // We may get non-CompoundVal accidentally due to imprecise cast logic or
   // that we are binding symbolic struct value. Kill the field values, and if
   // the value is symbolic go and bind it as a "default" binding.
-  if (V.isUnknown() || !isa<nonloc::CompoundVal>(V))
-    return KillStruct(store, R, isa<nonloc::SymbolVal>(V) ? V : UnknownVal());
+  if (V.isUnknown() || !isa<nonloc::CompoundVal>(V)) {
+    SVal SV = isa<nonloc::SymbolVal>(V) ? V : UnknownVal();
+    return KillStruct(store, R, SV);
+  }
 
   nonloc::CompoundVal& CV = cast<nonloc::CompoundVal>(V);
   nonloc::CompoundVal::iterator VI = CV.begin(), VE = CV.end();