forked from OSchip/llvm-project
[MachO] Fix struct size assertion
std::vector can have different sizes depending on the STL's debug level, so account for its size separately. (You could argue that we should be accounting for all the other members separately as well, but that would be very unergonomic, and std::vector is the only one that's caused problems so far.)
This commit is contained in:
parent
ae5348a38e
commit
2f5d6a0ea5
|
@ -26,8 +26,11 @@ using namespace llvm::support;
|
|||
using namespace lld;
|
||||
using namespace lld::macho;
|
||||
|
||||
// Verify ConcatInputSection's size on 64-bit builds.
|
||||
static_assert(sizeof(void *) != 8 || sizeof(ConcatInputSection) == 120,
|
||||
// Verify ConcatInputSection's size on 64-bit builds. The size of std::vector
|
||||
// can differ based on STL debug levels (e.g. iterator debugging on MSVC's STL),
|
||||
// so account for that.
|
||||
static_assert(sizeof(void *) != 8 ||
|
||||
sizeof(ConcatInputSection) == sizeof(std::vector<Reloc>) + 96,
|
||||
"Try to minimize ConcatInputSection's size, we create many "
|
||||
"instances of it");
|
||||
|
||||
|
|
Loading…
Reference in New Issue