From: Anna Zaks Date: Mon, 21 May 2012 22:07:00 +0000 (+0000) Subject: [analyzer] Bind UnknownVal to InitListExpr for unsupported types X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13dd47a0c01f8b4a6b3fbe379218f7ba8e692d0f;p=clang [analyzer] Bind UnknownVal to InitListExpr for unsupported types (ex: float). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157211 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/ExprEngineC.cpp b/lib/StaticAnalyzer/Core/ExprEngineC.cpp index 8a02b2ca96..2e3e9f51e7 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineC.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineC.cpp @@ -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, diff --git a/test/Analysis/cxx11-crashes.cpp b/test/Analysis/cxx11-crashes.cpp index 6e60ac63cc..a7bfe4ebe5 100644 --- a/test/Analysis/cxx11-crashes.cpp +++ b/test/Analysis/cxx11-crashes.cpp @@ -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}; +}