[PATCH] D19632: [scan-build] fix logic error warnings emitted on llvm code base
Apelete Seketeli via llvm-commits
llvm-commits at lists.llvm.org
Thu May 5 13:54:42 PDT 2016
On Tue, May-03-2016 at 04:39:45 PM +0100, Richard Osborne wrote:
> SecondLastInst should never be null at this point as we would have returned
> from the function earlier if there was only one terminator. It is also the
> case that SecondLastInst should be non null when the if statement on line
> 233 is executed:
>
> if (SecondLastInst && I != MBB.begin() && isUnpredicatedTerminator(*--I))
>
> Therefore this if condition can be changed to:
>
> if (I != MBB.begin() && isUnpredicatedTerminator(*--I))
>
> If the changing the if condition silences the static analyzer I think that
> would be a better fix.
The change you suggested silences the analyzer all the same indeed.
I'll push a new revision then.
Thanks for your review.
Cheers.
--
Apelete
More information about the llvm-commits
mailing list