summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/FoldingSet.cpp
diff options
context:
space:
mode:
authorSerge Pavlov <sepavloff@gmail.com>2018-05-29 07:05:41 +0000
committerSerge Pavlov <sepavloff@gmail.com>2018-05-29 07:05:41 +0000
commit1a095524f29c2861e47d181c83532211d32f6846 (patch)
treef1f335f75e6ab265fa1c7e4882b2aa37bd50ba0a /llvm/lib/Support/FoldingSet.cpp
parent335fa1eb04a011a6f174a82947efe6c8c3a4cd88 (diff)
downloadbcm5719-llvm-1a095524f29c2861e47d181c83532211d32f6846.tar.gz
bcm5719-llvm-1a095524f29c2861e47d181c83532211d32f6846.zip
Reverted commits 333390, 333391 and 333394
Build of shared library LLVMDemangle.so fails due to dependency problem. llvm-svn: 333395
Diffstat (limited to 'llvm/lib/Support/FoldingSet.cpp')
-rw-r--r--llvm/lib/Support/FoldingSet.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Support/FoldingSet.cpp b/llvm/lib/Support/FoldingSet.cpp
index ec7d57586e8..94237954903 100644
--- a/llvm/lib/Support/FoldingSet.cpp
+++ b/llvm/lib/Support/FoldingSet.cpp
@@ -214,8 +214,11 @@ static void **GetBucketFor(unsigned Hash, void **Buckets, unsigned NumBuckets) {
/// AllocateBuckets - Allocated initialized bucket memory.
static void **AllocateBuckets(unsigned NumBuckets) {
- void **Buckets = static_cast<void**>(safe_calloc(NumBuckets + 1,
- sizeof(void*)));
+ void **Buckets = static_cast<void**>(calloc(NumBuckets+1, sizeof(void*)));
+
+ if (Buckets == nullptr)
+ report_bad_alloc_error("Allocation of Buckets failed.");
+
// Set the very last bucket to be a non-null "pointer".
Buckets[NumBuckets] = reinterpret_cast<void*>(-1);
return Buckets;
OpenPOWER on IntegriCloud