diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-12-22 00:04:00 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-12-22 00:04:00 +0000 |
commit | 58c65fcb909c9c25d06507bcf41eb630b3d5e2da (patch) | |
tree | 4ab9ee4c0a177b5ff7aedbf68e86ac1276a544d0 /lib/CodeGen | |
parent | f132dcaae82ebfc44c4fe0e84bf0b1f95e9d1251 (diff) |
Fix a failure (which led to a crash) in constant emission code with vector compound literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 48eda17b7a..136b713910 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/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<CompoundLiteralExpr>(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(), |