mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-30 20:34:21 +00:00
[objc-arc] Fix assertion in EraseInstruction so that noop on null calls when passed null do not trigger the assert.
The specific case of interest is when objc_retainBlock is passed null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185885 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7b934079c0
commit
a75b293e4f
@ -286,7 +286,9 @@ static inline void EraseInstruction(Instruction *CI) {
|
||||
|
||||
if (!Unused) {
|
||||
// Replace the return value with the argument.
|
||||
assert(IsForwarding(GetBasicInstructionClass(CI)) &&
|
||||
assert((IsForwarding(GetBasicInstructionClass(CI)) ||
|
||||
(IsNoopOnNull(GetBasicInstructionClass(CI)) &&
|
||||
isa<ConstantPointerNull>(OldArg))) &&
|
||||
"Can't delete non-forwarding instruction with users!");
|
||||
CI->replaceAllUsesWith(OldArg);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user