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 | 4871a46cc399f463da7f87ca3ec9779ddd8dc3e8 (patch) | |
tree | 79ff6ed518d9b5f13b33845f5c8703eea2407162 /clang/lib/CodeGen/CGExprComplex.cpp | |
parent | 8c47bb1a029f6fb1bd823b89d1b8c25b372c93af (diff) | |
download | bcm5719-llvm-4871a46cc399f463da7f87ca3ec9779ddd8dc3e8.tar.gz bcm5719-llvm-4871a46cc399f463da7f87ca3ec9779ddd8dc3e8.zip |
Make sure we don't emit invalid IR for StmtExprs with complex cleanups.
Fixes <rdar://problem/14074868>.
llvm-svn: 183699
Diffstat (limited to 'clang/lib/CodeGen/CGExprComplex.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprComplex.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprComplex.cpp b/clang/lib/CodeGen/CGExprComplex.cpp index 36f974a3132..643ef91c891 100644 --- a/clang/lib/CodeGen/CGExprComplex.cpp +++ b/clang/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. |