Use std::vector for section patches

This commit is contained in:
Rangi42
2024-02-24 11:42:42 -05:00
committed by Sylvie
parent b207bff157
commit d792ee4b61
5 changed files with 154 additions and 127 deletions

View File

@@ -160,8 +160,8 @@ static void mergeSections(struct Section *target, struct Section *other, enum Se
other->data = NULL; // Prevent a double free()
}
// Adjust patches' PC offsets
for (uint32_t patchID = 0; patchID < other->nbPatches; patchID++)
other->patches[patchID].pcOffset += other->offset;
for (struct Patch &patch : *other->patches)
patch.pcOffset += other->offset;
} else if (target->data) {
assert(other->size == 0);
}