]> granicus.if.org Git - llvm/commit
[X86] X86InstrInfo::optimizeCompareInstr - fix potential null dereference.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 5 Sep 2019 10:18:24 +0000 (10:18 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 5 Sep 2019 10:18:24 +0000 (10:18 +0000)
commita10e7d61af25c987a324dc61371e68a8f72ca3d3
tree3b60ffb52bc7d230db70f2385081a9aa52303bd2
parentbfa7de776d70a950d41b46f3561e8c528e2ed960
[X86] X86InstrInfo::optimizeCompareInstr - fix potential null dereference.

Fixes clang static-analyzer warning.

Technically the MachineInstr *Sub might still be null if we're comparing zero (IsCmpZero == true), although this probably won't happen as SrcReg2 is probably == 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371047 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrInfo.cpp