]> granicus.if.org Git - clang/commitdiff
[analyzer] Bind UnknownVal to InitListExpr for unsupported types
authorAnna Zaks <ganna@apple.com>
Mon, 21 May 2012 22:07:00 +0000 (22:07 +0000)
committerAnna Zaks <ganna@apple.com>
Mon, 21 May 2012 22:07:00 +0000 (22:07 +0000)
(ex: float).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157211 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngineC.cpp
test/Analysis/cxx11-crashes.cpp

index 8a02b2ca9613abeff8147a50c1d29b9a07a2212d..2e3e9f51e7df154c65680f9c0897764664090f2d 100644 (file)
@@ -568,8 +568,10 @@ void ExprEngine::VisitInitListExpr(const InitListExpr *IE,
                                              state->getSVal(initEx, LCtx)));
     return;
   }
-  
-  llvm_unreachable("unprocessed InitListExpr type");
+
+  assert(IE->getNumInits() == 1);
+  B.generateNode(IE, Pred, state->BindExpr(IE, LCtx, UnknownVal()));
+  return;
 }
 
 void ExprEngine::VisitGuardedExpr(const Expr *Ex,
index 6e60ac63cc3a21823133989944b67ec86d97a619..a7bfe4ebe5f5ed7628e67c8ad9b5872dbf43fa92 100644 (file)
@@ -31,3 +31,8 @@ void radar11487541() {
   namespace fs = boost::filesystem;
   fs::path p;
 }
+
+// PR12873 radrar://11499139
+void testFloatInitializer() {
+  const float ysize={0.015}, xsize={0.01};
+}