[llvm-commits] [poolalloc] r98699 - /poolalloc/trunk/include/dsa/sv/set.h
Andrew Lenharth
andrewl at lenharth.org
Tue Mar 16 17:59:36 PDT 2010
Author: alenhar2
Date: Tue Mar 16 19:59:36 2010
New Revision: 98699
URL: http://llvm.org/viewvc/llvm-project?rev=98699&view=rev
Log:
avoid uninitialized access
Modified:
poolalloc/trunk/include/dsa/sv/set.h
Modified: poolalloc/trunk/include/dsa/sv/set.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/sv/set.h?rev=98699&r1=98698&r2=98699&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/sv/set.h (original)
+++ poolalloc/trunk/include/dsa/sv/set.h Tue Mar 16 19:59:36 2010
@@ -171,13 +171,13 @@
const_iterator find(const key_type& k) const {
const_iterator i = std::lower_bound(container_.begin(), container_.end(), k);
- if (*i == k) return i;
+ if (i != container_.end() && *i == k) return i;
return container_.end();
}
iterator find(const key_type& k) {
iterator i = std::lower_bound(container_.begin(), container_.end(), k);
- if (*i == k) return i;
+ if (i != container_.end() && *i == k) return i;
return container_.end();
}
More information about the llvm-commits
mailing list