mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-11 13:46:13 +00:00
Make sure the caller doesn't use freed memory.
Fixes PR1935. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46203 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ea74c7e498
commit
e003813e96
@ -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
Block a user