diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2013-06-10 22:04:49 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2013-06-10 22:04:49 +0000 |
| commit | 2ac2fa7726eb2f6fe445e098489e92931c31f7ca (patch) | |
| tree | 570cb17a18d3678b9d7a35db74c040a679db720c /lib/CodeGen/CGExprComplex.cpp | |
| parent | 7044668ecb518496e463ea2dacae100d4badfd19 (diff) | |
| download | clang-2ac2fa7726eb2f6fe445e098489e92931c31f7ca.tar.gz | |
Make sure we don't emit invalid IR for StmtExprs with complex cleanups.
Fixes <rdar://problem/14074868>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprComplex.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprComplex.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index 36f974a313..643ef91c89 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -358,7 +358,9 @@ ComplexPairTy ComplexExprEmitter::VisitCallExpr(const CallExpr *E) { ComplexPairTy ComplexExprEmitter::VisitStmtExpr(const StmtExpr *E) { CodeGenFunction::StmtExprEvaluation eval(CGF); - return CGF.EmitCompoundStmt(*E->getSubStmt(), true).getComplexVal(); + llvm::Value *RetAlloca = CGF.EmitCompoundStmt(*E->getSubStmt(), true); + assert(RetAlloca && "Expected complex return value"); + return EmitLoadOfLValue(CGF.MakeAddrLValue(RetAlloca, E->getType())); } /// EmitComplexToComplexCast - Emit a cast from complex value Val to DestType. |
