From 077707ccc0a4e829d7406645307581325dc49bb9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 16 Jun 2008 04:10:21 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/SimplifyLibCalls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- 2.34.1