summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-10-29 08:27:07 +0000
committerJim Laskey <jlaskey@mac.com>2006-10-29 08:27:07 +0000
commit8f05a611e951024dbd7d3a608df4de34d317a299 (patch)
treed759401e0daaa7d725b891d4c22a08190706d925 /llvm/lib/Support
parent7ab6123c426cd67f94d4c36aa7a7fa1f95ec4a8d (diff)
downloadbcm5719-llvm-8f05a611e951024dbd7d3a608df4de34d317a299.tar.gz
bcm5719-llvm-8f05a611e951024dbd7d3a608df4de34d317a299.zip
Not handling zero length strings.
llvm-svn: 31277
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/FoldingSet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/FoldingSet.cpp b/llvm/lib/Support/FoldingSet.cpp
index 2ae98760587..4fe67d7895e 100644
--- a/llvm/lib/Support/FoldingSet.cpp
+++ b/llvm/lib/Support/FoldingSet.cpp
@@ -61,7 +61,7 @@ void FoldingSetImpl::NodeID::AddString(const std::string &String) {
Pos = Units * sizeof(unsigned);
} else {
// Otherwise do it the hard way.
- for ( Pos += 4; Pos < Size; Pos += 4) {
+ for ( Pos += 4; Pos <= Size; Pos += 4) {
unsigned V = ((unsigned char)String[Pos - 4] << 24) |
((unsigned char)String[Pos - 3] << 16) |
((unsigned char)String[Pos - 2] << 8) |
@@ -77,7 +77,7 @@ void FoldingSetImpl::NodeID::AddString(const std::string &String) {
case 1: V = (V << 8) | (unsigned char)String[Size - 3]; // Fall thru.
case 2: V = (V << 8) | (unsigned char)String[Size - 2]; // Fall thru.
case 3: V = (V << 8) | (unsigned char)String[Size - 1]; break;
- case 0: return; // Nothing left.
+ default: return; // Nothing left.
}
Bits.push_back(V);
OpenPOWER on IntegriCloud