Fix coredump on undriven vector[-1].

This commit is contained in:
Wilson Snyder
2014-04-29 21:09:44 -04:00
parent c5aabb3c6e
commit 8f4f4eb5ae
2 changed files with 35 additions and 1 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ public:
private:
// METHODS
inline bool bitNumOk(int bit) const { return (bit*FLAGS_PER_BIT < (int)m_flags.size()); }
inline bool bitNumOk(int bit) const { return bit>=0 && (bit*FLAGS_PER_BIT < (int)m_flags.size()); }
inline bool usedFlag(int bit) const { return m_usedWhole || m_flags[bit*FLAGS_PER_BIT + FLAG_USED]; }
inline bool drivenFlag(int bit) const { return m_drivenWhole || m_flags[bit*FLAGS_PER_BIT + FLAG_DRIVEN]; }
enum BitNamesWhich { BN_UNUSED, BN_UNDRIVEN, BN_BOTH };