1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00

Fix some logic I broke that caused a regression on

SimplifyLibCalls/2005-05-20-sprintf-crash.ll

llvm-svn: 23430
This commit is contained in:
Chris Lattner 2005-09-25 07:06:48 +00:00
parent e6bfd80169
commit d8febfc4aa

View File

@ -1500,9 +1500,11 @@ public:
new CallInst(memcpy_func, args, "", ci);
// The strlen result is the unincremented number of bytes in the string.
if (!ci->use_empty() && Len->getType() != ci->getType())
Len = new CastInst(Len, ci->getType(), Len->getName(), ci);
ci->replaceAllUsesWith(Len);
if (!ci->use_empty()) {
if (Len->getType() != ci->getType())
Len = new CastInst(Len, ci->getType(), Len->getName(), ci);
ci->replaceAllUsesWith(Len);
}
ci->eraseFromParent();
return true;
}