Fix an off-by-one error that broke Prolangs/deriv2 with llc on x86
and Prolangs-C/cdecl
llvm-svn: 35749
diff --git a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
index a3be345..8aed1e8 100644
--- a/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -780,7 +780,7 @@
// 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);