From df73c300bc6bbae4685d83cd5a7e2b1c0c7f6ef7 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Wed, 7 Aug 2013 05:51:27 +0000 Subject: YAMLTraits.h: replace DenseMap that used a bad implementation of DenseMapInfo for StringRef with a StringMap The bug is that the empty key compares equal to the tombstone key. Also added an assertion to DenseMap to catch similar bugs in future. llvm-svn: 187866 --- llvm/lib/Support/YAMLTraits.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support/YAMLTraits.cpp') diff --git a/llvm/lib/Support/YAMLTraits.cpp b/llvm/lib/Support/YAMLTraits.cpp index 1e42b63e8d5..b0cd4151863 100644 --- a/llvm/lib/Support/YAMLTraits.cpp +++ b/llvm/lib/Support/YAMLTraits.cpp @@ -127,8 +127,8 @@ void Input::endMapping() { return; for (MapHNode::NameToNode::iterator i = MN->Mapping.begin(), End = MN->Mapping.end(); i != End; ++i) { - if (!MN->isValidKey(i->first)) { - setError(i->second, Twine("unknown key '") + i->first + "'"); + if (!MN->isValidKey(i->first())) { + setError(i->second, Twine("unknown key '") + i->first() + "'"); break; } } -- cgit v1.2.3