summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-07-08 23:30:23 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-07-08 23:30:23 +0000
commitc1b648f6c01977a2c50ea77ece9885fe01ecd6a8 (patch)
tree60f27ce9dba19451a39362718a9ab3b6d3c6bfdc /llvm/lib
parente61c907792948436397e6fd958ab851b314b6c35 (diff)
downloadbcm5719-llvm-c1b648f6c01977a2c50ea77ece9885fe01ecd6a8.tar.gz
bcm5719-llvm-c1b648f6c01977a2c50ea77ece9885fe01ecd6a8.zip
[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. llvm-svn: 185885
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/ObjCARC/ObjCARC.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARC.h b/llvm/lib/Transforms/ObjCARC/ObjCARC.h
index 39670f339e9..1462e85991a 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARC.h
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARC.h
@@ -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);
}
OpenPOWER on IntegriCloud