summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-04-20 23:14:50 +0000
committerChris Lattner <sabre@nondot.org>2011-04-20 23:14:50 +0000
commit54fd1a1ad3e603f56c8409de0a87c175b0a8ea2c (patch)
tree357c5f82fd7049a1cdfd4c12a9c57b8ea218c41a /clang/lib
parentd70ca52081a6a01c634dfb112f04025704e0bd83 (diff)
downloadbcm5719-llvm-54fd1a1ad3e603f56c8409de0a87c175b0a8ea2c.tar.gz
bcm5719-llvm-54fd1a1ad3e603f56c8409de0a87c175b0a8ea2c.zip
fix a crash on code that uses the result value of __builtin___memcpy_chk.
llvm-svn: 129892
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 51d9eebaba1..e553eb6c278 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud