diff --git a/llvm/include/llvm/IR/InstrTypes.h b/llvm/include/llvm/IR/InstrTypes.h index 70e6de019db8..189c5bc63275 100644 --- a/llvm/include/llvm/IR/InstrTypes.h +++ b/llvm/include/llvm/IR/InstrTypes.h @@ -112,7 +112,7 @@ public: typedef SuccIterator Self; inline bool index_is_valid(unsigned idx) { - return idx >= 0 && idx < TermInst->getNumSuccessors(); + return idx < TermInst->getNumSuccessors(); } /// \brief Proxy object to allow write access in operator[]