summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
index a3be34577f8..8aed1e8103b 100644
--- a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -780,7 +780,7 @@ public:
// do the concatenation for us.
Value *MemcpyOps[] = {
Dst, Src,
- ConstantInt::get(SLC.getIntPtrType(), SrcLen), // length including nul.
+ ConstantInt::get(SLC.getIntPtrType(), SrcLen+1), // length including nul.
ConstantInt::get(Type::Int32Ty, 1) // alignment
};
new CallInst(SLC.get_memcpy(), MemcpyOps, 4, "", CI);
OpenPOWER on IntegriCloud