From 5c9cd7a8a3e823f8ee72592f95ba1a406dfc7e6a Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Thu, 22 Dec 2011 00:04:00 +0000 Subject: Fix a failure (which led to a crash) in constant emission code with vector compound literals. llvm-svn: 147111 --- clang/lib/CodeGen/CGExprConstant.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGExprConstant.cpp') diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index 48eda17b7a8..136b7139108 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -870,7 +870,8 @@ public: // Note that due to the nature of compound literals, this is guaranteed // to be the only use of the variable, so we just generate it here. CompoundLiteralExpr *CLE = cast(E); - llvm::Constant* C = Visit(CLE->getInitializer()); + llvm::Constant* C = CGM.EmitConstantExpr(CLE->getInitializer(), + CLE->getType(), CGF); // FIXME: "Leaked" on failure. if (C) C = new llvm::GlobalVariable(CGM.getModule(), C->getType(), -- cgit v1.2.3