From 59a4f9af0a2e94ec04840a066251eca34bf3e3f8 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 23 Jul 2011 03:04:46 +0000 Subject: [PATCH] Fix a silly off by one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135842 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCRegisterInfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/MC/MCRegisterInfo.h b/include/llvm/MC/MCRegisterInfo.h index 1deb4ef2524..ada5ae80af0 100644 --- a/include/llvm/MC/MCRegisterInfo.h +++ b/include/llvm/MC/MCRegisterInfo.h @@ -76,7 +76,7 @@ public: bool contains(unsigned Reg) const { unsigned InByte = Reg % 8; unsigned Byte = Reg / 8; - if (Byte > RegSetSize) + if (Byte >= RegSetSize) return false; return (RegSet[Byte] & (1 << InByte)) != 0; }