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. llvm-svn: 333518
This commit is contained in:
@@ -596,8 +596,10 @@ const StructLayout *DataLayout::getStructLayout(StructType *Ty) const {
|
||||
// Otherwise, create the struct layout. Because it is variable length, we
|
||||
// malloc it, then use placement new.
|
||||
int NumElts = Ty->getNumElements();
|
||||
StructLayout *L = (StructLayout *)
|
||||
safe_malloc(sizeof(StructLayout)+(NumElts-1) * sizeof(uint64_t));
|
||||
StructLayout *L =
|
||||
(StructLayout *)malloc(sizeof(StructLayout)+(NumElts-1) * sizeof(uint64_t));
|
||||
if (L == nullptr)
|
||||
report_bad_alloc_error("Allocation of StructLayout elements failed.");
|
||||
|
||||
// Set SL before calling StructLayout's ctor. The ctor could cause other
|
||||
// entries to be added to TheMap, invalidating our reference.
|
||||
|
||||
Reference in New Issue
Block a user