diff options
| author | John McCall <rjmccall@apple.com> | 2012-03-28 23:30:44 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2012-03-28 23:30:44 +0000 |
| commit | 1a0877f99dc8130f3b85ab096bc03059e4c3cd0a (patch) | |
| tree | ed675c50db4cc6b68ac8636470be7746e92b6814 /clang/lib/CodeGen/CGException.cpp | |
| parent | 7e58b3862a61b1297e1e6a12e14205d1d2df346b (diff) | |
| download | bcm5719-llvm-1a0877f99dc8130f3b85ab096bc03059e4c3cd0a.tar.gz bcm5719-llvm-1a0877f99dc8130f3b85ab096bc03059e4c3cd0a.zip | |
When we can't prove that the target of an aggregate copy is
a complete object, the memcpy needs to use the data size of
the structure instead of its sizeof() value. Fixes PR12204.
llvm-svn: 153613
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGException.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 95e0030866d..dcb921261a1 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -373,8 +373,7 @@ static void EmitAnyExprToExn(CodeGenFunction &CGF, const Expr *e, // evaluated but before the exception is caught. But the best way // to handle that is to teach EmitAggExpr to do the final copy // differently if it can't be elided. - CGF.EmitAnyExprToMem(e, typedAddr, e->getType().getQualifiers(), - /*IsInit*/ true); + CGF.EmitAnyExprToMem(e, typedAddr, e->getType().getQualifiers()); // Deactivate the cleanup block. CGF.DeactivateCleanupBlock(cleanup, cast<llvm::Instruction>(typedAddr)); @@ -1048,7 +1047,8 @@ static void InitCatchParam(CodeGenFunction &CGF, if (!copyExpr) { llvm::Value *rawAdjustedExn = CallBeginCatch(CGF, Exn, true); llvm::Value *adjustedExn = CGF.Builder.CreateBitCast(rawAdjustedExn, PtrTy); - CGF.EmitAggregateCopy(ParamAddr, adjustedExn, CatchType); + CGF.EmitAggregateCopy(ParamAddr, adjustedExn, CatchType, + /*volatile*/ false, 0, /*destIsCompleteObject*/ true); return; } @@ -1076,7 +1076,8 @@ static void InitCatchParam(CodeGenFunction &CGF, AggValueSlot::forAddr(ParamAddr, Alignment, Qualifiers(), AggValueSlot::IsNotDestructed, AggValueSlot::DoesNotNeedGCBarriers, - AggValueSlot::IsNotAliased)); + AggValueSlot::IsNotAliased, + AggValueSlot::IsCompleteObject)); // Leave the terminate scope. CGF.EHStack.popTerminate(); |

