Skip to content

Commit

Permalink
Align trampoline to 2 bytes to pass mfp check
Browse files Browse the repository at this point in the history
  • Loading branch information
shqke committed Dec 16, 2024
1 parent 4b062f6 commit 0ed6ccd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ void Allocator::free(uint8_t* address, size_t size) {

std::expected<Allocation, Allocator::Error> Allocator::internal_allocate_near(
const std::vector<uint8_t*>& desired_addresses, size_t size, size_t max_distance) {
// Align to 2 bytes to pass MFP virtual method check
// See https://itanium-cxx-abi.github.io/cxx-abi/abi.html#member-function-pointers
size = align_up(size, 2);

// First search through our list of allocations for a free block that is large
// enough.
for (const auto& allocation : m_memory) {
Expand Down

0 comments on commit 0ed6ccd

Please sign in to comment.