Correctly implement ImmutableMap::getMaxElement() by getting the actual <key, value...
authorTed Kremenek <kremenek@apple.com>
Mon, 23 Feb 2009 17:28:16 +0000 (17:28 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 23 Feb 2009 17:28:16 +0000 (17:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65327 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ImmutableMap.h

index 00d59028aa07a04bc34c654ca7c485d8f2814ac1..52708bc8a10873ae2e11f9c08b5b60d46f5afc67 100644 (file)
@@ -207,7 +207,7 @@ public:
   ///  which key is the highest in the ordering of keys in the map.  This
   ///  method returns NULL if the map is empty.
   value_type* getMaxElement() const {
   ///  which key is the highest in the ordering of keys in the map.  This
   ///  method returns NULL if the map is empty.
   value_type* getMaxElement() const {
-    return Root ? &(Root->getMaxElement()) : 0;
+    return Root ? &(Root->getMaxElement()->getValue()) : 0;
   }
 
   //===--------------------------------------------------===//
   }
 
   //===--------------------------------------------------===//