diff --git a/llvm/include/llvm/ADT/ScopedHashTable.h b/llvm/include/llvm/ADT/ScopedHashTable.h index b5ca374a7ddd46acfb5ecd9a3baa72baf53eed2a..c96ad19707f38a2bdade59507120bde1bd05078b 100644 --- a/llvm/include/llvm/ADT/ScopedHashTable.h +++ b/llvm/include/llvm/ADT/ScopedHashTable.h @@ -139,7 +139,12 @@ public: } V lookup(const K &Key) { - return TopLevelMap[Key]->getValue(); + typename DenseMap*, KInfo>::iterator + I = TopLevelMap.find(Key); + if (I != TopLevelMap.end()) + return I->second->getValue(); + + return V(); } void insert(const K &Key, const V &Val) {