diff options
author | Chris Lattner <sabre@nondot.org> | 2011-04-20 23:14:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-04-20 23:14:50 +0000 |
commit | 42f681b83378de1541919c7f72e7555e35158867 (patch) | |
tree | 70fa07469c26bf019d922a3c4d19da3dd7f30ece /lib/CodeGen/CGBuiltin.cpp | |
parent | a10ae7b895737694ddc3f0f3fc6105c4871fef23 (diff) |
fix a crash on code that uses the result value of __builtin___memcpy_chk.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129892 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGBuiltin.cpp')
-rw-r--r-- | lib/CodeGen/CGBuiltin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index 51d9eebaba..e553eb6c27 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -556,7 +556,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, Value *Src = EmitScalarExpr(E->getArg(1)); Value *SizeVal = llvm::ConstantInt::get(Builder.getContext(), Size); Builder.CreateMemCpy(Dest, Src, SizeVal, 1, false); - return RValue::get(0); + return RValue::get(Dest); } case Builtin::BI__builtin_objc_memmove_collectable: { @@ -581,7 +581,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, Value *Src = EmitScalarExpr(E->getArg(1)); Value *SizeVal = llvm::ConstantInt::get(Builder.getContext(), Size); Builder.CreateMemMove(Dest, Src, SizeVal, 1, false); - return RValue::get(0); + return RValue::get(Dest); } case Builtin::BImemmove: @@ -616,7 +616,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, Value *SizeVal = llvm::ConstantInt::get(Builder.getContext(), Size); Builder.CreateMemSet(Address, ByteVal, SizeVal, 1, false); - return RValue::get(0); + return RValue::get(Address); } case Builtin::BI__builtin_dwarf_cfa: { // The offset in bytes from the first argument to the CFA. |