forked from OSchip/llvm-project
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:
parent
0b3557f54a
commit
f487768062
|
@ -1500,9 +1500,11 @@ public:
|
||||||
new CallInst(memcpy_func, args, "", ci);
|
new CallInst(memcpy_func, args, "", ci);
|
||||||
|
|
||||||
// The strlen result is the unincremented number of bytes in the string.
|
// The strlen result is the unincremented number of bytes in the string.
|
||||||
if (!ci->use_empty() && Len->getType() != ci->getType())
|
if (!ci->use_empty()) {
|
||||||
|
if (Len->getType() != ci->getType())
|
||||||
Len = new CastInst(Len, ci->getType(), Len->getName(), ci);
|
Len = new CastInst(Len, ci->getType(), Len->getName(), ci);
|
||||||
ci->replaceAllUsesWith(Len);
|
ci->replaceAllUsesWith(Len);
|
||||||
|
}
|
||||||
ci->eraseFromParent();
|
ci->eraseFromParent();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue