Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions bolt/lib/Core/BinaryContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,14 +1010,12 @@ bool BinaryContext::hasValidCodePadding(const BinaryFunction &BF) {
return Offset - StartOffset;
};

// Skip a sequence of zero bytes. For AArch64 we only skip 4 bytes of zeros
// in case the following zeros belong to constant island or veneer.
// Skip a sequence of zero bytes. For AArch64 we only skip 4's exact
// multiple number of zeros in case the following zeros belong to veneer.
auto skipZeros = [&]() {
const uint64_t StartOffset = Offset;
uint64_t CurrentOffset = Offset;
for (; CurrentOffset < BF.getMaxSize() &&
(!isAArch64() || CurrentOffset < StartOffset + 4);
++CurrentOffset)
for (; CurrentOffset < BF.getMaxSize(); ++CurrentOffset)
if ((*FunctionData)[CurrentOffset] != 0)
break;

Expand Down
Loading