[AVR] Fix null dereference warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 8 Oct 2020 17:05:09 +0000 (18:05 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 8 Oct 2020 18:04:29 +0000 (19:04 +0100)
commitdf9ae806bba497e9fd76ff0da74c1ab8ab08d75b
treec249dc854e75d8d9d6a770eb1f488de7ac5a5c22
parent3cc1f1fc1d97952136185f4eafb827694875de17
[AVR] Fix null dereference warning. NFCI.

We were checking if the ConstantSDNode was null but then immediately dereferencing it afterward - fold these both into a single check. Use the APInt::ult() helper as well.

Found by clang static analyzer.
llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp