From: Chris Lattner Date: Mon, 16 Jun 2008 04:10:21 +0000 (+0000) Subject: Fix the crash on SimplifyLibCalls/2005-05-20-sprintf-crash.ll X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=077707ccc0a4e829d7406645307581325dc49bb9;p=oota-llvm.git Fix the crash on SimplifyLibCalls/2005-05-20-sprintf-crash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52295 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp index 30c9baf2770..79ec3d941fb 100644 --- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp +++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp @@ -128,7 +128,7 @@ Value *LibCallOptimization::EmitStrLen(Value *Ptr, IRBuilder &B) { Value *LibCallOptimization::EmitMemCpy(Value *Dst, Value *Src, Value *Len, unsigned Align, IRBuilder &B) { Module *M = Caller->getParent(); - Intrinsic::ID IID = TD->getIntPtrType() == Type::Int32Ty ? + Intrinsic::ID IID = Len->getType() == Type::Int32Ty ? Intrinsic::memcpy_i32 : Intrinsic::memcpy_i64; Value *MemCpy = Intrinsic::getDeclaration(M, IID); return B.CreateCall4(MemCpy, CastToCStr(Dst, B), CastToCStr(Src, B), Len,