aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-26 05:00:15 +0000
committerChris Lattner <sabre@nondot.org>2004-02-26 05:00:15 +0000
commit7c78afefe96669cc3eb886308291213415d9d7b0 (patch)
tree4fca3a84f3ff1134291e89da4217cccb6e51b6b9 /include/llvm
parent271143fbe8aebeca1b298efe4bad3916206fd784 (diff)
downloadexternal_llvm-7c78afefe96669cc3eb886308291213415d9d7b0.zip
external_llvm-7c78afefe96669cc3eb886308291213415d9d7b0.tar.gz
external_llvm-7c78afefe96669cc3eb886308291213415d9d7b0.tar.bz2
Fix a bug in the densemap that was killing the local allocator, and probably
other clients. The problem is that the nullVal member was left to the default constructor to initialize, which for int's does nothing (ie, leaves it unspecified). To get a zero value, we must use T(). It's C++ wonderful? :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11867 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/ADT/DenseMap.h2
-rw-r--r--include/llvm/ADT/IndexedMap.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/ADT/DenseMap.h b/include/llvm/ADT/DenseMap.h
index 9d713d9..9d55435 100644
--- a/include/llvm/ADT/DenseMap.h
+++ b/include/llvm/ADT/DenseMap.h
@@ -33,7 +33,7 @@ class DenseMap {
ToIndexT toIndex_;
public:
- DenseMap() { }
+ DenseMap() : nullVal_(T()) { }
explicit DenseMap(const T& val) : nullVal_(val) { }
diff --git a/include/llvm/ADT/IndexedMap.h b/include/llvm/ADT/IndexedMap.h
index 9d713d9..9d55435 100644
--- a/include/llvm/ADT/IndexedMap.h
+++ b/include/llvm/ADT/IndexedMap.h
@@ -33,7 +33,7 @@ class DenseMap {
ToIndexT toIndex_;
public:
- DenseMap() { }
+ DenseMap() : nullVal_(T()) { }
explicit DenseMap(const T& val) : nullVal_(val) { }