mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
Revert commit 333506
It looks like this commit is responsible for the fail: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/24382. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333518 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -59,8 +59,10 @@ void StringMapImpl::init(unsigned InitSize) {
|
||||
NumTombstones = 0;
|
||||
|
||||
TheTable = static_cast<StringMapEntryBase **>(
|
||||
safe_calloc(NewNumBuckets+1,
|
||||
std::calloc(NewNumBuckets+1,
|
||||
sizeof(StringMapEntryBase **) + sizeof(unsigned)));
|
||||
if (TheTable == nullptr)
|
||||
report_bad_alloc_error("Allocation of StringMap table failed.");
|
||||
|
||||
// Set the member only if TheTable was successfully allocated
|
||||
NumBuckets = NewNumBuckets;
|
||||
@@ -218,7 +220,9 @@ unsigned StringMapImpl::RehashTable(unsigned BucketNo) {
|
||||
// Allocate one extra bucket which will always be non-empty. This allows the
|
||||
// iterators to stop at end.
|
||||
auto NewTableArray = static_cast<StringMapEntryBase **>(
|
||||
safe_calloc(NewSize+1, sizeof(StringMapEntryBase *) + sizeof(unsigned)));
|
||||
std::calloc(NewSize+1, sizeof(StringMapEntryBase *) + sizeof(unsigned)));
|
||||
if (NewTableArray == nullptr)
|
||||
report_bad_alloc_error("Allocation of StringMap hash table failed.");
|
||||
|
||||
unsigned *NewHashArray = (unsigned *)(NewTableArray + NewSize + 1);
|
||||
NewTableArray[NewSize] = (StringMapEntryBase*)2;
|
||||
|
||||
Reference in New Issue
Block a user