From: Chris Lattner Date: Sat, 7 Apr 2007 20:19:08 +0000 (+0000) Subject: Fix an off-by-one error that broke Prolangs/deriv2 with llc on x86 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=af33e6579a76611db02014e574bc4314cfb703df;p=oota-llvm.git Fix an off-by-one error that broke Prolangs/deriv2 with llc on x86 and Prolangs-C/cdecl git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35749 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/IPO/SimplifyLibCalls.cpp b/lib/Transforms/IPO/SimplifyLibCalls.cpp index a3be34577f8..8aed1e8103b 100644 --- a/lib/Transforms/IPO/SimplifyLibCalls.cpp +++ b/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);