forked from OSchip/llvm-project
Make sure the caller doesn't use freed memory.
Fixes PR1935. llvm-svn: 46203
This commit is contained in:
parent
da19b1c875
commit
afa84da4e0
|
@ -401,8 +401,10 @@ static bool OptimizeNoopCopyExpression(CastInst *CI, const TargetLowering &TLI){
|
|||
}
|
||||
|
||||
// If we removed all uses, nuke the cast.
|
||||
if (CI->use_empty())
|
||||
if (CI->use_empty()) {
|
||||
CI->eraseFromParent();
|
||||
MadeChange = true;
|
||||
}
|
||||
|
||||
return MadeChange;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue