summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index e14c9f01c61..b990c199953 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -280,7 +280,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
case Builtin::BI__builtin_memset: {
Value *Address = EmitScalarExpr(E->getArg(0));
Builder.CreateCall4(CGM.getMemSetFn(), Address,
- EmitScalarExpr(E->getArg(1)),
+ Builder.CreateTrunc(EmitScalarExpr(E->getArg(1)),
+ llvm::Type::Int8Ty),
EmitScalarExpr(E->getArg(2)),
llvm::ConstantInt::get(llvm::Type::Int32Ty, 1));
return RValue::get(Address);
OpenPOWER on IntegriCloud