From 2b315a35774a6028b49ad6c2d44aa65119120f52 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 26 Feb 2004 05:00:15 +0000 Subject: [PATCH] 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? :) llvm-svn: 11867 --- include/Support/DenseMap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Support/DenseMap.h b/include/Support/DenseMap.h index 9d713d97c36..9d55435c91f 100644 --- a/include/Support/DenseMap.h +++ b/include/Support/DenseMap.h @@ -33,7 +33,7 @@ class DenseMap { ToIndexT toIndex_; public: - DenseMap() { } + DenseMap() : nullVal_(T()) { } explicit DenseMap(const T& val) : nullVal_(val) { }