Commits
Michael Gottesman committed 88929f8e999
Fix implicit assumption that RetainArray is not nullptr.
The code in question was the following:
auto *RetainArray = dyn_cast_or_null<StrongRetainInst>(getInstBefore(Call));
if (!RetainArray && MayHaveBridgedObjectElementType)
return false;
auto *ReleaseArray = dyn_cast_or_null<StrongReleaseInst>(getInstAfter(Call));
if (!ReleaseArray && MayHaveBridgedObjectElementType)
return false;
if (ReleaseArray &&
ReleaseArray->getOperand() != RetainArray->getOperand())
return false;
There is no check in the last if if RetainArray is not nullptr even though it is
possible for it to be so.
Found by clang static analyzer.