aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/include/llvm/ADT/StringSet.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/include/llvm/ADT/StringSet.h')
-rw-r--r--contrib/llvm/include/llvm/ADT/StringSet.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/llvm/include/llvm/ADT/StringSet.h b/contrib/llvm/include/llvm/ADT/StringSet.h
index 9c55f6b70e36..b69a964a23ba 100644
--- a/contrib/llvm/include/llvm/ADT/StringSet.h
+++ b/contrib/llvm/include/llvm/ADT/StringSet.h
@@ -29,8 +29,13 @@ namespace llvm {
assert(!InLang.empty());
const char *KeyStart = InLang.data();
const char *KeyEnd = KeyStart + InLang.size();
- return base::insert(llvm::StringMapEntry<char>::
- Create(KeyStart, KeyEnd, base::getAllocator(), '+'));
+ llvm::StringMapEntry<char> *Entry = llvm::StringMapEntry<char>::
+ Create(KeyStart, KeyEnd, base::getAllocator(), '+');
+ if (!base::insert(Entry)) {
+ Entry->Destroy(base::getAllocator());
+ return false;
+ }
+ return true;
}
};
}